Need help! I want to add an image with CSS

Discussion in 'CSS' started by leftwheel, Aug 10, 2009.

  1. #1
    Hi!

    I'm just designing a wordpress template at:

    http://janwei.startlogic.com/testblog/

    Now i want to place an image left next to the content part to make it look like the pink color is flowing down a little more.

    How do i add this image? I tried it with this code:

    #header Image1 {
    position:absolute;
    right:22px;
    top: 450px;
    width:36px;
    height:142px;
    background-image: url(images/bckimage1.gif)
     
    leftwheel, Aug 10, 2009 IP
  2. Whizkid

    Whizkid Well-Known Member

    Messages:
    324
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    135
    #2
    You need to make Image1 into a class in your css and html.


    
    <div id="header">
    <h1><a href="http://janwei.startlogic.com/testblog/">mygroovez</a></h1>
    <p>Just another WordPress weblog</p>
    <div class="Image1"></div>
    </div>
    
    HTML:
    [FONT=monospace]
    [/FONT]#header .Image1 {
             position:absolute;
             right:22px;
             top: 450px;
             width:36px;
             height:142px;
             background-image: url(images/bckimage1.gif)
    }
    
    Code (markup):
    Note the period before Image1. Since Image1 isn't an html element (h1, p, img, etc.), you need to make a class to define it.
     
    Whizkid, Aug 10, 2009 IP
  3. leftwheel

    leftwheel Well-Known Member

    Messages:
    725
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Works great. Thanks.
     
    leftwheel, Aug 10, 2009 IP
  4. leftwheel

    leftwheel Well-Known Member

    Messages:
    725
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    135
    #4
    I have another question: Can you tell me how to link this picture?
     
    leftwheel, Aug 18, 2009 IP
  5. 1 FineLine

    1 FineLine Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    whizkid has it linked in his example
     
    1 FineLine, Aug 19, 2009 IP
  6. leftwheel

    leftwheel Well-Known Member

    Messages:
    725
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    135
    #6
    no, he didn't link it. He just uses the link to define the image. What i need is to make the image a link. So when someone clicks the image he comes to another page.
     
    leftwheel, Aug 19, 2009 IP