Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Navbar ul/li centers except last item only in FF
Old 11-07-2005, 02:42 AM Navbar ul/li centers except last item only in FF
eJM
eJM's Avatar
Skilled Talker

Posts: 72
Name: Jim McClain
Location: teh Ether
Trades: 0
I've been working to eliminate the nested tables from my flooring site (http://jmfloorcovering.com). I also decided to get rid of the JavaScript used in the upper navbar too. My efforts have resulted in this: http://www.jmfloorcovering.com/test/...eader_nav.html

I have tried to follow the advice that some have given to other people concerning navbars using UL/LI techniques. For a n00b, I am not unhappy with what I've done so far, but it really puzzles me why the navbar is centered nicely in IE and Opera, but drops the last nav item to the next line in FireFox.

You are welcome to download the CSS file, but here is the relevant section for your perusal:

Code:
#topnav {
	position: relative;
	top: 150px;
	background-color: transparent;
	margin: auto;
	width: 552px;
	height: 30px;
	text-align: center;
	z-index: 300;
}
#navbar_t ul
{
	margin: 0;
	padding: 0;
	list-style: none;
}
#navbar_t li
{
	float: left;
	list-style-type: none;
}
#navbar_t li.tile
{
	background-color: transparent;
	width: 25px;
	height: 30px;
}
#navbar_t li.home
{
	background:url(images/nav/btn_home_f2.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.about
{
	background:url(images/nav/btn_about_f2.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.projects
{
	background:url(images/nav/btn_projects_f2.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.guides
{
	background:url(images/nav/btn_guides_f2.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.resources
{
	background:url(images/nav/btn_resources_f2.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t a
{
	display: block;
	width: 90px;
	height: 30px;
}
#navbar_t li.home a
{
	background:url(images/nav/btn_home.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.about a
{
	background: url(images/nav/btn_about.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.projects a
{
	background:url(images/nav/btn_projects.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.guides a
{
	background:url(images/nav/btn_guides.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
#navbar_t li.resources a
{
	background:url(images/nav/btn_resources.gif) no-repeat left top;
	width: 90px;
	height: 30px;
}
ul#navbar_t a:hover
{
	background: transparent;
}
ul#navbar_t a:focus
{
	background: transparent;
}
Here, too, is the relevant markup:

Code:
<div id="topnav">
	<ul id="navbar_t">
		<li class="home"><a href="#"></a></li>
		<li class="tile"><img src="images/nav/navtile.gif" alt="" /></li>
		<li class="about"><a href="#"></a></li>
		<li class="tile"><img src="images/nav/navtile.gif" alt="" /></li>
		<li class="projects"><a href="#"></a></li>
		<li class="tile"><img src="images/nav/navtile.gif" alt="" /></li>
		<li class="guides"><a href="#"></a></li>
		<li class="tile"><img src="images/nav/navtile.gif" alt="" /></li>
		<li class="resources"><a href="#"></a></li>
	</ul>
</div>
I've tried several things, including changing the width of the container from 552px to 600px and to 100%. Both resizes put the navbar all on one line, but the 600px (and I tried a lot of numbers in between) made the navbar off-center by 20 or 30 pixels and 100% made the navbar move all the way to the left side of the browser.

I hope someone can guide me to a solution. Next, I will be adding popup (drop-down) menus to all the buttons except Home.

Thank you,

Grump
eJM is offline
Reply With Quote
View Public Profile Visit eJM's homepage!
 
 
Register now for full access!
Old 11-07-2005, 11:51 AM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
change
Code:
#navbar_t ul
{
	margin: 0;
	padding: 0;
	list-style: none;
}
to

Code:
#navbar_t
{
	margin: 0;
	padding: 0;
	list-style: none;
}
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 11-07-2005, 01:10 PM
eJM
eJM's Avatar
Skilled Talker

Posts: 72
Name: Jim McClain
Location: teh Ether
Trades: 0
Thank you. That was too easy.
eJM is offline
Reply With Quote
View Public Profile Visit eJM's homepage!
 
Reply     « Reply to Navbar ul/li centers except last item only in FF
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58636 seconds with 12 queries