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
Padding Collapses on Navbar Link (in Firefox)
Old 09-04-2007, 12:19 PM Padding Collapses on Navbar Link (in Firefox)
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
Any idea why the padding collapses when clicking on the navbar link in Firefox?

The padding returns to normal when clicking again outside of the navbar.

I tried adding 30px right and left padding to a new rule (#nav ul li a:visited) but this didn't work.

http://www.diamondpackaging.com/green/
http://www.diamondpackaging.com/green/diamond8e.css
wilbury is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-05-2007, 12:35 AM Re: Padding Collapses on Navbar Link (in Firefox)
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
I changed the

#nav ul li{
padding: 0px;
margin: 0px;
display: inline;
}


to

#nav li {
margin: 0px;
display: inline;
}

and
<div id="nav">
<ul>

to

<div>
<ul id="nav">

then it worked for me
joder is offline
Reply With Quote
View Public Profile
 
Old 09-05-2007, 03:02 PM Re: Padding Collapses on Navbar Link (in Firefox)
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
Joder,

Thanks for the input.

While testing the behavior of this code the only thing I could surmise was that the divider marks (|) were somehow causing the link margins to collapse when clicking the link.

What I did was separate the | marks into their own <li>|<li> line items, and modify the CSS by setting the padding for the line items (#nav ul li ) instead of the links (#nav ul li a):

#nav ul li{
padding: 0px 15px;
margin: 0px;
display: inline;
}

#nav ul li a{
text-decoration: none;
font-weight: bold;
color: #FFFFFF;
}

#nav ul li a:hover, #nav ul li a:focus{
color: #3366FF;
}

Now it seems to work in both IE6 and Firefox. Even though it was working in IE6 before, perhaps it was a fluke rather than a bug in Firefox? If anyone has a better method of putting divider lines between links in the navbar I would love to learn how. The problem with using right and left border declarations is that the borders would show on each end of the navbar and I want to avoid that.

Thanks,
Wilbury

http://www.diamondpackaging.com/green/
http://www.diamondpackaging.com/green/diamond8e.css

Last edited by wilbury; 09-05-2007 at 03:04 PM..
wilbury is offline
Reply With Quote
View Public Profile
 
Old 09-08-2007, 01:12 PM Re: Padding Collapses on Navbar Link (in Firefox)
danfinney's Avatar
Average Talker

Posts: 22
Name: Dan Finney
Trades: 0
Wilbury,

Can you post a version without your temporary fix? I can't give you a definite answer without seeing the code, but as a guess I would say that your bold declaration in "#nav ul li a" was applying only to the link and not to your plaintext " | " and causing a size problem. I would try putting the bold declaration in "#nav ul li" instead. Or it could be the padding needs to be in the "#nav ul li a" instead of "#nav ul li"

Good luck!
__________________
d a n f i n n e y

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
danfinney is offline
Reply With Quote
View Public Profile Visit danfinney's homepage!
 
Old 09-09-2007, 11:09 AM Re: Padding Collapses on Navbar Link (in Firefox)
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Or it could be the padding needs to be in the "#nav ul li a" instead of "#nav ul li"
Dan, I've seen the code without his 'fix' and he did have padding set on the #nav ul li a rather than the li item. I think you are definitely correct about the "|" as the padding was applied to the <a> and not the plain text.
__________________
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 Padding Collapses on Navbar Link (in Firefox)
 

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