In order to make the "a" tag smaller and avoid the overlap you have to set display to block, and the height to your desired height. But I have a screenshots of some weird handling of this when I get back to my computer. Strange it is.
Ok.. I've been playing around with it for a bit and then I remembered that explorer has a bug with list items and links. For some reason if you add a border it'll fix the line-height problem, but then you have the problem with the border. I updated your css, so just swap out the old styles with the ones below. I made the border purple so you can see what I'm talking about. Hopefully that'll work for you, otherwise I don't think there is a solution. You might have to live with a border, just make it the same color as the background and no one will ever know :)
That doesn't work either... here is the screen shot I was talking about.
Notice the dotted outline, that is the clickable area (even though firebug shows that the "a" link is contained within the purple borders.) For some reason the clickable are still overlaps when the anchor link does not extend beyond the borders.
} ul { border:1px solid blue; } .navbar ul li { position:relative; display:inline; top:0px; font-family:\"Arial Black\", Gadget, Helvetica, Arial, sans-serif; font-size:60px; position:relative; padding:0px; color:red;
} .navbar ul li a, .navbar ul li a:link { border:1px solid red; }
.navbar ul li a:visited { color:#484340; }
.navbar ul li a:hover { color:#fa297d; padding-left:5px; }
if you try and get them closer your going to have problems, the reason for this is that your font is 60px but the extra padding is from the font.... there is nothing you can do about this, unless you change fonts to see if there is any that can hit the border.
so really the font is your issue. try this with other sizes and you will notice the "padding" is still there.
I was going crazy trying to figure this out. It took me 15 minutes to find the right keywords to use in google to even find a thread. After reading this thread, I thought "there HAS to be a way" and while there is probably still a cleaner method, I think I might have a solution for you.
Let's say your links are set up like this (most importantly, they have a class called "aFix")
You'll end up with your links getting pushed up by 10 pixels, but I think you could compensate by giving a class name to your <li> tags and defining a CSS class that compensates with padding-top or something like that.
Depending on the font you're using, you'll want to play with the the last three values for font-size, height and margin-top. Give it a whirl and you'll see what it's doing.
I didn't test this with list items, but it is working with my code where the links are wraped in divs instead of list items.
i.e.:
the buginess being that when you mouse over the lower portion of "TOO" , the "BIG?" is in it's hover state and is clickable. ...
help?
The full section(s) of your CSS dealing with lists and anchors would be helpful.
here's a link to the live example:
http://www.beechersmithstackhouse.info/buggs.html
thanks
.navbar ul li {
line-height: .825em;
}
Hopefully that'll help... good luck!
I set the line-height for both the:
.navbar ul li
and
.navbar ul li a
to no avail .... i'll update the live example.
any other thoughts?
Notice the dotted outline, that is the clickable area (even though firebug shows that the "a" link is contained within the purple borders.) For some reason the clickable are still overlaps when the anchor link does not extend beyond the borders.
http://img.photobucket.com/albums/v69/blue642/Untitled-1.jpg
if you try and get them closer your going to have problems, the reason for this is that your font is 60px but the extra padding is from the font.... there is nothing you can do about this, unless you change fonts to see if there is any that can hit the border.
so really the font is your issue. try this with other sizes and you will notice the "padding" is still there.
surely there is a solution other than using images ...
... anyone ? ...
Let's say your links are set up like this (most importantly, they have a class called "aFix")
In your CSS try doing something like this:
a.aFix {display:block;
overflow:hidden;
font-size:36px;
height:30px;
margin-top:-10px;
}
You'll end up with your links getting pushed up by 10 pixels, but I think you could compensate by giving a class name to your <li> tags and defining a CSS class that compensates with padding-top or something like that.
Depending on the font you're using, you'll want to play with the the last three values for font-size, height and margin-top. Give it a whirl and you'll see what it's doing.
I didn't test this with list items, but it is working with my code where the links are wraped in divs instead of list items.