![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
According to my book, the padding property is defined for all elements. However, when I set the property for the element <A>, only the left the right padding is applied and not the top and bottom padding. |
#2
| |||
| |||
|
|
Top and bottom padding is applied on the font height (not line height) of linked text. Also applies if the hyperlinked content is not text like an image IIRC. Unfortunately, I am at a loss then on how to make this work. Do you have suggestions? |
|
Also, do you have a URL for where the above information can be found? |
#3
| |||
| |||
|
|
well, I believe I found the answer to this question. Setting the line-height property to 1.2 for the <A> element appears to provide me with the behavior I want. |
|
I am curious about the reason why the top and bottom padding does not work the way I expected it to. |
#4
| |||
| |||
|
|
line-height:1.2; |
|
I am curious about the reason why the top and bottom padding does not work the way I expected it to. Because your expectations are wrong. That much is obvious. |
#5
| |||
| |||
|
|
Eric wrote: line-height:1.2; 1.2 what, apples, monkey noodles? |
#6
| |||
| |||
|
|
Spartanicus <me (AT) privacy (DOT) net> wrote: Eric wrote: well, I believe I found the answer to this question. Setting the line-height property to 1.2 for the <A> element appears to provide me with the behavior I want. Wrong, as I've said before it's applied on the _font_ height, _not_ the line height. Perhaps I wasn't clear...I am no longer using the padding property. Only the line-height property, which apparently will do what I need it to do, which is to provide some extra spacing between links on adjacent lines. Specifically, #GameNavigationBar A { line-height:1.2; } If you have another concrete solution to this problem, I would be interested in learning about it. I have put a test page at |
#7
| |||
| |||
|
|
David Graham <david.graham18 (AT) ntlworld (DOT) com> wrote: I have put a test page at http://p0c79.phpwebhosting.com/~p0c79/test117.html The padding on the first link seems to behave as I would expect and the line-height is also behaving OK. Is this not what you see. (tested in IE6, Mozilla 1.4 and Opera 7.1 Try putting a <br> after the first 'This is some link text' and remove the line-height:3.0 from it as well. I think you will see that the second 'This is some link text' overlaps with the first...at least it does for me under mozilla 1.5, IE 5.2.3 and Safari. |
|
However, by putting the line-height property back into the first one, the second one now appears below the first with no overlap. So, the true problem might be that while the padding is being applied, what should appear below overlaps. Looks like a bug to me. |
#8
| |||
| |||
|
|
It also explains why the left and right padding, and indeed the left and right borders only appear at the start and end of the element, not at the start and end of each line, |
#9
| |||
| |||
|
|
Steve Pugh <steve (AT) pugh (DOT) net> wrote: If you add padding to an inline element you must adjust the line-height property accordingly. In most cases you could (and should) just use line-height on its own. Is it possible to make sure that the line-height is only large enough to encompass an element with padding and no larger? |
![]() |
| Thread Tools | |
| Display Modes | |
| |