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.

CSS Forum


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



Reply
Problem with padding on anchor tags in FF3
Old 02-16-2009, 07:32 PM Problem with padding on anchor tags in FF3
freeman17's Avatar
Average Talker

Posts: 16
Trades: 0
Ok, this appears just fine in IE6/7 but not Firefox. I have a horizontal navigation bar and there is extra space in-between the links in FF. Since I have a background color to appear when hovering over the links, the padding in-between the links will change colors, but not the entire link.

I hope I could explain it well enough, here is my code:

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
</head>

<body>

<div class="headerwrap">
</div>
<div class="nav">
<ul>
<a href="one.html"><li>Link1</li></a>
<a href="two.html"><li>Link2</li></a>
<a href="three.html"><li>Link3</li></a>
</ul>
</div>
<div class="main">
Main
</div>
<div class="footer">
Footer
</div>
</body>
</html>



CSS (just put in the navigation bar CSS)

.nav {
width:750px;
margin:0px auto;
padding:0px;
text-align:center;
}

.nav ul {
margin:0px;
padding:0px;
list-style:none;
width:750px;
}

.nav ul li {
display:inline;
}

.nav ul a {
font-size:14px;
padding:3px 7px;
line-height:30px;
text-decoration:none;
font-weight:bold;
color:#ffffff;
}

.nav a:hover {
background-color:#e1b900;
}



I was also wondering, I was planning on identifying the current page that the users will be on, probably with just a different background color and text color. How would I over-ride that so that the "a:hover" still doesn't affect the current page link?
freeman17 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-17-2009, 04:23 PM Re: Problem with padding on anchor tags in FF3
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
add display:block to .nav ul a so that it will highlight the ENTIRE link space.

Quote:
How would I over-ride that so that the "a:hover" still doesn't affect the current page link?
Create a new class, such as "selected", specify the color, etc., add that class to the current page's link as in: <a class="selected" href........>
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with padding on anchor tags in FF3
 

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.22693 seconds with 12 queries