Log in

View Full Version : How to increase text line spacing with css



jcdesigns
01-15-2011, 03:51 AM
My text line spacing is too close and I need to add a little more space between the lines. My entire website is like this. Is there a way I can do this with css. See link.Thanks

http://www.ifcnc.com/services.html

bluewalrus
01-15-2011, 05:15 AM
Yes, the line-height property.

http://www.w3.org/TR/CSS21/visudet.html#line-height

codeparrot
01-15-2011, 05:16 AM
If it's for the entire website, then you could implement this into your CSS file:



body {
line-height:16px;
}


Change the 16px to whatever size fits the best. G'luck :)

bluewalrus
01-15-2011, 06:05 PM
You can use pixels on line height? My understanding of line height was that it was a fixed number (1.2) which was then multiplied by the font size of the element.

codeparrot
01-15-2011, 10:03 PM
You can use pixels on line height? My understanding of line height was that it was a fixed number (1.2) which was then multiplied by the font size of the element.

Yes you can. In fact, you can test it out here:

http://www.w3schools.com/css/tryit.asp?filename=trycss_dim_line-height_pixel

costigan
01-17-2011, 11:45 AM
Check your CSS sheet, in this file your enter one more lign with "space-content" and you define the space in px