Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    What's with this CSS code? Why is it doing this?

    Help!

    I'm trying to learn the ropes of making a PHP dynamic website, through various tutorials and books.

    Now, this is a CSS question. From one tutorial I've been reading, he uses this basic CSS template and I wonder why it isn't working correctly?

    Here's the code he provided for the tutorial:

    Code:
    
    
    body {
    	margin: auto;
    	background-color:#ffffff;
    	font-family: georgia,sans-serif;
    	color:#333;
    	}
    	 
    	#wrapper {
    	width:1024px;
    	background-color:#ffffff;
    	margin: auto;
    	}
    	 
    	#header {
    	width:1024px;
    	height:824px;
    	background-image: url(http://www.tim-searles.com/dbc/imgs/banner.png);
    	background-repeat: no-repeat;
    	}
    	 
    	#header h2 {
    	padding:10px;
    	}
    	 
    	#nav {
    	width:1024px;
    	height:53px;
    	background-image: url(http://www.tim-searles.com/dbc/imgs/nav_bg.png);
    	background-repeat: no-repeat;
    	margin: auto;
    	}
    	 
    	#nav a {
    	display:inline;
    	padding:10px;
    	text-decoration:none;
    	background-color:#f1f1f1;
    	}
    	 
    	#nav a:hover {
    	background-color:#bababa;
    	height:80px;
    	}
    	 
    	#content {
    	width:675px;
    	float:left;
    	padding:10px;
    	}
    	 
    	#sidebar {
    	width:200px;
    	float:right;
    	margin-bottom:25px;
    	}
    	 
    	#sidebar a {
    	text-decoration:none;
    	}
    	 
    	#sidebar li {
    	list-style:none;
    	}
    	 
    	#footer {
    	clear:both;
    	width:960px;
    	height:135px;
    	border-top:1px solid #ccc;
    	}
    	 
    	#footer p {
    	padding:10px;
    	}

    and this: http://www.tim-searles.com/dbc/

    is the ending result with my own images. Why is my nav bar so far down? Help.

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,925
    Thanks
    46
    Thanked 203 Times in 202 Posts
    because you made your header 824px high

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    New Coder
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by alykins View Post
    because you made your header 824px high
    Well, I'm a dumbass. ha, thanks.

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,925
    Thanks
    46
    Thanked 203 Times in 202 Posts
    lol no prob; we all have those days

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • Users who have thanked alykins for this post:

    zoobs (07-06-2011)


  •  

    Posting Permissions

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