OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Centering a horizontal menu.
This page's ID:
11058
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I may not be able to explain this right, but the code should be good enough for most of you. I have a menu that is a list. I want this menu to be horizontal and centered. By resorting to float: right/left I have managed to fullfill all criteria except centering. Is there a way to do this in CSS? Have I gone about it in all the wrong ways? Here's the code. CSS first: [code] #menu{ position: absolute; top: 190px; } #menu a:link, #menu a:visited, #menu a:active{ color: #a5a5a5; display: list-item; list-style-type: none; width: 100px; height: 14px; margin: 3px; padding: 2px; border-style: solid; border-width: 3px; border-color: #7b7b7b; text-decoration: none; text-align: center; font-weight: bold; background-color: #851D30; float: right; } #menu a:hover{ background-color: #FBD76F; color: #a5a5a5; } [/code] And html: [code] <!--Menu--> <div id="menu"> <a href="1.html">Main</a> <a href="1.html">News Archive</a> <a href="1.html">Members</a> <a href="1.html">Heritage</a> <a href="1.html">FAQ</a> <a href="1.html">Contact</a> </div> [/code] [Edit: I should also say that I don't have a total grasp of CSS. I don't understand exactly why I have to add float to get the list to appear horizontally or if there is any other way to do it. Some dummied down explanations would be nice if you've got the time. Cheers!] [Edit2: I should also say that I have to be able to preserve the block-only formatting things.] [img]http://xavier.tamu.edu/students/rar7655/web/images/sig5.gif[/img] It's pronounced "Spikes!" [This message has been edited by SPyX (edited 09-26-2003).] [This message has been edited by SPyX (edited 09-26-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »