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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    absolute position problem.

    I wonder why I cant make my list menu with absolute postion exactly at the bottom of my header without any margin. I think its because the link is inside the ul. please show me some solution.

    Code:
    <!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>Untitled Document</title>
    <style type="text/css">
    
    #main {
    	margin: auto;
    	background: #333333;
    	widows: 900px;
    	height: 900px;
    }	
    #head {
    	background:#006633;
    	position: relative;
    	height: 200px;
    }	
    #menu{
    	position: absolute;
    	bottom: 0;
    
    }
    #menu li{
    	list-style: none;
    	display: inline;
    }
    </style>
    </head>
    
    <body>
    
    
    
    <div id="main">
    
    
    <div id="head">
    
    <div id="menu">
    <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Blog</a></li>
    <li><a href="#">Forum</a></li>
    </ul>
    
    </div>
    </div>
    
    </div>
    
    
    
    </body>
    </html>
    Last edited by swordsman; 11-04-2011 at 05:05 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,668
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello swordsman,
    Remove margin by adding this bit to your CSS -
    #menu ul {margin: 0;}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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