Results 1 to 5 of 5

Thread: Gap on top of my header

  1. #1
    Join Date
    Dec 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Gap on top of my header

    hello, i need some header image help please. i have a gap of about 10px on top between my header image and my site top border. i did put padding and margin to 0px on both the container and header selector without success.
    This is my css file
    Code:
    #header{
    		   background: black;
    		   margin:0;
    		   padding:0;
    		   background-image:url(images/header.jpg) ;
    		   height:114px;
    		}
    		
    		 #header h3{
    		   color:red;
    		   background: black;
    		}
    		
    		#container {
    		  width:770px;
    		  margin:0 auto;
    		  text-align:left;
    		  border:5px solid #FFF;
    		  }
    And this how my xhtml codes look like:
    Code:
    <body>
    <div id="container">
    
    	<div id="header"> 
    		<h1>header</h1> 
        </div>
    
        <div id="navigation"></div>
     <div id="wrapper">
            <div id="main-content">
    etc..
    anyway to fix that gap on top of my header please?
    many thanks.

  2. #2
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try setting the margin of the <H1> to 0.

    If you want a gap, set the padding instead.

  3. #3
    Join Date
    Dec 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    thanks Benni Austin, it works .however, when i tried to to set the gap on top again, it would not let me. Any idea why?
    many thanks.

  4. #4
    Join Date
    Dec 2006
    Location
    Twin Cities, MN
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    h1 {
      margin:0;
      padding:10px;
    }
    That should have the desired effect, if you're desired effect is what I think.

    You want the margin inside of the header, rather than outside. using on the <h1> should emulate a margin in this way.

  5. #5
    Join Date
    Dec 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks benni . very helpful.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •