March 10, 2012
remove line height from the second line
Question by Sowmya Shivaram
I have given line height of 60px for a tag but wen content is more, it goes to second line but even second line is taking line height of 60px. How do I remove line-height from second line?
Here line height is necessary to vertically middle align the text to div.
a.pname
{ font-family:Verdana, Geneva, sans-serif; font-size:14px;
color:#000; text-align:left; font-weight:normal;
text-decoration:none; line-height:65px;
float:left; background-color:#090; width:190px
}
Answer by Starx
Use :first-line
pseudoelement to select only the first line. Remove the line-height
property from your style and add this
a.pname:first-line { line-height: 65px; }