Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-27-2012, 03:44 AM   PM User | #1
Bagels
New to the CF scene

 
Join Date: Apr 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Bagels is an unknown quantity at this point
Question Background not showing up properly in header

I'm trying to build a website from a chopped up photoshop file as a learning exercise. The problem I'm running into is that while everything looks fine in dreamweaver when I go into a browser everything shifts around and only a part of my back ground will appear.

Here's the HTML
Code:
   		<div id="header">
            <div id="logo"><img src="images/PI_3D_Logo.gif" width="224" height="70" alt="Premier Image Logo" /> 
            </div>
            
            
           <div id="social-media-icons">
                    <ul>
                        <li><a href="http://www.facebook.com"><img src="images/icons/facebook.png" /></a></li>
                        <li><a href="http://www.twitter.com"><img src="images/icons/twitter.png" /></a></li>
                        <li><a href="#"><img src="images/icons/rss.png" /></a></li>
                        <li><a href="#"><img src="images/icons/email.png" /></a></li>
                    </ul>
           </div>
                  <div id="topnav">
                <ul>
                    <li><a href="index.html">HOME</a></li>
                    <li><a href="contact.html">ETIMATES </a>                    </li>
                    <li><a href="contact.html">CONTACTS</a></li></ul>
            </div> 
           


                       
		</div>
and the CSS

Code:
#header					{ width:900px; height: margin: 0 auto; background:url(../images/Header.png) top no-repeat;clear:both		}	
	
#logo					{ margin: 5px 0px; float:left	}

#social-media-icons			{ float:right;  }
#social-media-icons	ul li	{ display:inline;	}
#social-media-icons ul		{ margin-top: 40px;margin-right:25px} }
		
#topnav					{ clear:both; width:900px; }
#topnav ul				{ margin: 25px 0 13px 150px; padding: 10px 0;	}
#topnav ul li			{ display:inline;	}
#topnav ul li a			{ padding: 0 20px;	}
I know it's something simple that I'm overlooking. When it renders the only part of the background that is visible is where it fits into the navigation bar
Bagels is offline   Reply With Quote
Old 04-27-2012, 03:58 AM   PM User | #2
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
Quote:
Originally Posted by Bagels View Post
I'm trying to build a website from a chopped up photoshop file as a learning exercise. The problem I'm running into is that while everything looks fine in dreamweaver when I go into a browser everything shifts around and only a part of my back ground will appear.

Here's the HTML
Code:
   		<div id="header">
            <div id="logo"><img src="images/PI_3D_Logo.gif" width="224" height="70" alt="Premier Image Logo" /> 
            </div>
            
            
           <div id="social-media-icons">
                    <ul>
                        <li><a href="http://www.facebook.com"><img src="images/icons/facebook.png" /></a></li>
                        <li><a href="http://www.twitter.com"><img src="images/icons/twitter.png" /></a></li>
                        <li><a href="#"><img src="images/icons/rss.png" /></a></li>
                        <li><a href="#"><img src="images/icons/email.png" /></a></li>
                    </ul>
           </div>
                  <div id="topnav">
                <ul>
                    <li><a href="index.html">HOME</a></li>
                    <li><a href="contact.html">ETIMATES </a>                    </li>
                    <li><a href="contact.html">CONTACTS</a></li></ul>
            </div> 
           


                       
		</div>
and the CSS

Code:
#header					{ width:900px; height: margin: 0 auto; background:url(../images/Header.png) top no-repeat;clear:both		}	
	
#logo					{ margin: 5px 0px; float:left	}

#social-media-icons			{ float:right;  }
#social-media-icons	ul li	{ display:inline;	}
#social-media-icons ul		{ margin-top: 40px;margin-right:25px} }
		
#topnav					{ clear:both; width:900px; }
#topnav ul				{ margin: 25px 0 13px 150px; padding: 10px 0;	}
#topnav ul li			{ display:inline;	}
#topnav ul li a			{ padding: 0 20px;	}
I know it's something simple that I'm overlooking. When it renders the only part of the background that is visible is where it fits into the navigation bar
You have not set the actual Height of the Header in the CSS

You have
Code:
#header					{ width:900px; height: margin: 0 auto; background:url(../images/Header.png) top no-repeat;clear:both		}
But it should look something like
Code:
#header					{ width:900px; height:100px; margin: 0 auto; background:url(../images/Header.png) top no-repeat;clear:both		}
aaronhockey_09 is offline   Reply With Quote
Users who have thanked aaronhockey_09 for this post:
Bagels (04-27-2012)
Old 04-27-2012, 04:12 AM   PM User | #3
Bagels
New to the CF scene

 
Join Date: Apr 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Bagels is an unknown quantity at this point
Hurf Durf, That was left in from when I had tried height before and was apparently forgetting to add the px. Thanks, I knew it had to be something like this.
Bagels is offline   Reply With Quote
Old 04-27-2012, 04:15 AM   PM User | #4
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
Quote:
Originally Posted by Bagels View Post
Hurf Durf, That was left in from when I had tried height before and was apparently forgetting to add the px. Thanks, I knew it had to be something like this.
Not a problem.
Don't forget to thank
Cheers.
aaronhockey_09 is offline   Reply With Quote
Old 04-27-2012, 05:11 AM   PM User | #5
Bagels
New to the CF scene

 
Join Date: Apr 2012
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Bagels is an unknown quantity at this point
Reputation =/= Thank
Bagels is offline   Reply With Quote
Reply

Bookmarks

Tags
background, css

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:07 AM.


Advertisement
Log in to turn off these ads.