Current location: Hot Scripts Forums » General Web Coding » CSS » Problems with list-based horizontal navigation


Problems with list-based horizontal navigation

Reply
  #1 (permalink)  
Old 09-12-06, 02:37 PM
allhop allhop is offline
New Member
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Problems with list-based horizontal navigation

Hello,

Thanks in advance to all who reply.

I am trying to create a navigation bar inside the DIV #mainNav. I would like the links to be the same height as #mainNav, however, the following problems are occurring:

- In Firefox (see attached file Fig1): Extra space is showing up underneath the links, so when I hover over the link, the color does not extend to the bottom of #mainNav.

- In IE (see attached file Fig2): Extra space is showing up above the links, and the links are extended below the #mainNav. This is causing extra space to occur between #mainNav and the following DIV.

XHTML Code:
Code:
<div id="mainNav">
	<ul>
		<li><a href="laborpro.com" title="Home">Home</a></li>
		<li><a href="laborpro.com/services" title="Services">Services</a></li>
		<li><a href="laborpro.com/ratesfees" title="Rates & Fees">Rates & Fees</a></li>
		<li><a href="laborpro.com/resources" title="Resources">Resources</a>
		<li><a href="laborpro.com/aboutus" title="About Us">About Us</a>
		<li><a href="laborpro.com/contact" title="Contact">Contact</a>
	</ul>
</div>
CSS Code:
Code:
#mainNav {
	width:778px;
	height:40px;
	margin-top: 0;
	margin-right:auto;
	margin-bottom: 0;
	margin-left:auto;
	background:#50729F;
}

#mainNav li {
	margin:0;
	padding:0;
	display: inline;
	list-style-type: none;
}

#mainNav a {
	float:left;
	line-height: 14px;
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	padding:10px 30px 10px 30px;
	text-decoration: none;
	background:#50729F;
	color:#FFFFFF;
}

#mainNav a:hover {
	background:#663300;
}
Attached Images
File Type: jpg Fig1.jpg (31.2 KB, 71 views)
File Type: jpg Fig2.jpg (30.5 KB, 74 views)

Last edited by nico_swd; 09-12-06 at 03:19 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-12-06, 05:24 PM
allhop allhop is offline
New Member
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Never mind. I added #mainNav ul {display:inline} and adjusted the line-height and that fixed the problems.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dyanamic list box based on a variable solovaz JavaScript 0 01-16-04 04:02 AM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 09:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.