SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Float question
-
Nov 28, 2004, 12:47 #1
- Join Date
- Mar 2001
- Location
- Highlands Ranch, Colorado
- Posts
- 614
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Float question
I am kinda new working with CSS. I am trying to center a menu on a website, but I guess "center" is just not the right way to do it. So, how do I get my menu bar into the middle?
Code:<table border="0" cellpadding="0" cellspacing="0" width="100%" id="wrapper" align="center"> <tr> <td colspan="2"> <div id="header" ><center> <img src="$script[imgfolder]logo3a.gif" alt="" /> </div></center> <div id="navbar"> <div style="float:right;font-weight:bold;"><a href="index.php">Home</a> | <a href="index.php?advsearch">Advanced Search</a> | <a href="index.php?topart">Most Popular</a> | <a href="index.php?toprated">Top Rated</a> | <a href="index.php?rss">RSS Syndicate</a> | <a href="index.php?do=sitemap">Sitemap</a> | <a href="http://www.webhostingreport.net">Forum</a></div> </div> </td> </tr>
Thanks for any hint.
ChristophThe-USA dot net - PR4 Web Directory
-
Nov 28, 2004, 12:58 #2
- Join Date
- Feb 2003
- Location
- Slave I
- Posts
- 23,424
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
try:
margin: auto;
That's the CSS way to center a block elevel element.
-
Nov 28, 2004, 18:30 #3
- Join Date
- Mar 2001
- Location
- Highlands Ranch, Colorado
- Posts
- 614
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hm, that did not work (at least in my situation). I had removed the float:right; from aboves code example and replaced it with the "margin: auto;". Any idea? Is that the wrong place to center the menu bar?
ChristophThe-USA dot net - PR4 Web Directory
-
Nov 28, 2004, 19:01 #4
- Join Date
- Mar 2001
- Location
- Highlands Ranch, Colorado
- Posts
- 614
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, found it.
text-align: center
At least it worked in my situation.
ChristophThe-USA dot net - PR4 Web Directory
Bookmarks