Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change inline text height, not just the line-height?

Tags:

css

I am wondering if it's possible to change the height of inline text, without stretching the font, and without changing the line height in css.

An issue comes up when I have multi-line links with a hover effect: when moused over the lines the effect flickers on and off because of the increased line height: Example

Is there another way to do this?

like image 676
Kuba Holuj Avatar asked Jun 03 '09 04:06

Kuba Holuj


People also ask

How do I change inline font size?

To change the size of your text with inline CSS, you have to do it with the style attribute. You type in the font-size property, and then assign it a value.

How do I change font size and line height?

Sets line height to be equal to a multiple of the font size. If your font size is 10px, your line height will be 10px, 18px, and 20px, respectively. Sets line height as a percentage of the font size of the element. If your font size is 10px, your line height will be 3px, 5px, and 11px respectively.

Can line height be less than font size?

If the value of the line-height property is smaller than the value of the font-size , text may overflow the element, and text on one line may overlap text on another line above or below it. It is often convenient to set the value of the line-height in the font shorthand property.


2 Answers

You can increase height of font using below css

transform:scale(2,3); /* W3C */ -webkit-transform:scale(2,3); /* Safari and Chrome */ -moz-transform:scale(2,3); /* Firefox */ -ms-transform:scale(2,3); /* IE 9 */ -o-transform:scale(2,3); /* Opera */ 

JSFIDDLE

like image 61
Prashant Tapase Avatar answered Sep 20 '22 13:09

Prashant Tapase


You won't be able to change the height of the font alone but you can adjust the font-size to work with the line height you have set.

like image 37
Andrew Hare Avatar answered Sep 18 '22 13:09

Andrew Hare