| | |
css to make navigation bar
Please support our HTML and CSS advertiser: 50% Off 6 Months Web Hosting from 1&1. The World's #1 Host!
![]() |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 17
I am trying to make a navigation bar using a list. Since a list is indented by default, I can't seem to get my list all the way to the left. I have looked at examples of this, but am not sure how they are doing it. Below is what I have
HTML and CSS Syntax (Toggle Plain Text)
<html> <head> <title>test4</title> <style type="text/css"> ul { list-style-type: none; float: left; } li { display: inline; padding: 2px; border-style: solid; border-left-width: 0px; border-top-width: 1px; border-bottom-width: 1px; border-right-width: 1px;} li.first { border-left-width: 1px; } </style> </head> <body> <ul> <li class="first">first</li><li>second</li><li>third</li><li>fourth</li> </ul> </body> </html>
In a perfect world exceptions would not be needed.
•
•
Join Date: Sep 2006
Posts: 9
Reputation:
Solved Threads: 1
•
•
•
•
I am trying to make a navigation bar using a list. Since a list is indented by default, I can't seem to get my list all the way to the left. I have looked at examples of this, but am not sure how they are doing it. Below is what I have
HTML and CSS Syntax (Toggle Plain Text)
<html> <head> <title>test4</title> <style type="text/css"> ul { list-style-type: none; margin: 0; float: left; } li { display: inline; padding: 2px; border-style: solid; border-left-width: 0px; border-top-width: 1px; border-bottom-width: 1px; border-right-width: 1px;} li.first { border-left-width: 1px; } </style> </head> <body> <ul> <li class="first">first</li><li>second</li><li>third</li><li>fourth</li> </ul> </body> </html>
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
When dealing with "spacing" issues in CSS, always check to ensure that both the margin and the padding properties are properly set for all elements, including all parent/container objects and so on all the way up the tree. In fact, it's best to set margin and padding both to "0" to establish a baseline or "natural" position for everything, and then adjust as needed.
![]() |
Similar Threads
- Tutorial: Photoshop: create a tabbed navigation bar (Graphics and Multimedia)
- Navigation Bar that extends the length of the page (HTML and CSS)
Other Threads in the HTML and CSS Forum
- Previous Thread: Need help with table problem, urgent.
- Next Thread: HTML - Clickable Regions - help needed...
Views: 15958 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 alignment background beta blog browser browserproblems cart center chrome code compatibility containers create css deleted design designing distortion div division divs dreamweaver drupal editor emailmarketing embed explorer firefox float font fonts format free frontpage google helprequired-urgent hosting html ide ie6 ie7 iframe image images input internet internetexplorer iphone javascript jpeg js links list login macbook map maps margin marketshare microsoft missing mozilla multimedia navigationbars newb object opacity opera override player pnginie6 position positioning prevent problem relative scroll seo shopping strings studio table tables tag templates theme tips translation validation visual w3c web webform website websitedesign windows7 wordpress xhtml xml






