1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Header not positioned properly

Discussion in 'CSS' started by Kremechoco, Jan 8, 2012.

  1. #1
    top.png

    As you can see in the attachment,my header (the green portion) wont go to the top left, there is still some space there. I try using several different elements and no luck. Suggestions?
     
    Solved! View solution.
    Kremechoco, Jan 8, 2012 IP
  2. JamesD31

    JamesD31 Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Post a live link, or HTML and CSS coding so we can see how you are coding it. Seeing an example doesn't help very much.

    THOUGH make sure in your CSS your body looks like:

    
    body {
        margin: 0;
        padding: 0;
        ... w/e else
    }
    
    Code (markup):
     
    JamesD31, Jan 8, 2012 IP
  3. #3
    Just add margin: 0 auto; to your body and it'll be fixed ;)
     
    wiicker95, Jan 8, 2012 IP
  4. Kremechoco

    Kremechoco Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    CSS:
    
    .header {
    	background-image: url(bgheader.png);
    	background-repeat: repeat-x;
            padding: 0;
    	margin: 0;
    }
    
    Code (markup):
    HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Site</title>
    <link href="Project/main.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div class=header><img src="Project/title.png" alt="Site" width="355" height="151" vspace="0" /></div>
    
    </body>
    </html>
    HTML:
     
    Kremechoco, Jan 8, 2012 IP
  5. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #5
    Just put what I already posted and it'll work ;)
     
    wiicker95, Jan 8, 2012 IP
  6. Kremechoco

    Kremechoco Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    OHH! Hahah. Didn't think I'd have to make a body. Just though I had to add onto my header class. Thanks!
     
    Kremechoco, Jan 8, 2012 IP