www.webdeveloper.com
Results 1 to 2 of 2

Thread: CSS List menu aligning on topnav

  1. #1
    Join Date
    Dec 2002
    Location
    US
    Posts
    128

    CSS List menu aligning on topnav

    Hello,

    I have a list style of links on the left and some links on the right of topnav. The problem I having is the links do no properly line up so well on the top navigation. The links go off on the right, and the links on the left is not correctly aligned either.

    What do I need to do to correct this?


    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="styles/template.css" />
    <title>CSS Layout</title>
    </head>
    <body>
    
    <div id="layout">
    
    	<div id="topnav">
    		<ul>
    		<li><a href="#">Text</a></li>
    		<li><a href="#">Text</a></li>
    		<li><a href="#">Text</a></li>
    		</ul>
    		
    		<p><a href="#">Facebook</a>&nbsp;&nbsp;<a href="#">Twitter</a></p>
    	</div>
    
      	
    </div>
    
    
    </body>
    </html>
    Code:
    #layout {
      	width: 100%;
      	margin-left: auto;
      	margin-right: auto;
    }
    
    #topnav { 
    	width: auto;
    	height: 50px;
    	margin: 0 auto;
    	background-color: #9cf;
    }
    
    #topnav li {
     	display: inline;
     	list-style-type: none;
     	padding-right: 20px;
    }
    
    #topnav p { 
    	width: 150px; 
    	float: right;
    	margin: 0px;
    }

  2. #2
    Join Date
    Dec 2002
    Location
    US
    Posts
    128
    Problem solved. I got figured out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles