|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Line-height affecting spacing above first line
I've got two lines of text. Want the spacing the two lines to increase, so I set a line-height. When I do this, not only does it increase space between the two lines, it also increases spacing above the first line (and maybe below the second). How can I increase spacing between the two lines only, without increasing above and below? Thanks!
|
|
#2
|
||||
|
||||
|
Please show us your code.
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. |
|
#3
|
|||
|
|||
|
Quote:
Code:
<div style="width:150px; line-height:30px; background-color:#ccc; padding:0; margin:0;">Notice how there is additional space between the first line of text and the top of the div.</div> <p></p> <div style="width:150px; background-color:#ccc; padding:0; margin:0;">With no line-height specified, there is almost no space between the first line of text and the top of the div.</div> I don't want the space above the first line of text. |
|
#4
|
||||
|
||||
|
To do that you would have to manually split them.
Why do you want to do that anyway? |
|
#5
|
||||
|
||||
|
Quote:
Quote:
|
|
#6
|
|||
|
|||
|
Why can't you split them?
Or you could add a negative top margin. |
|
#7
|
|||
|
|||
|
Quote:
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Line-height affecting spacing above first line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|