• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Text Properties > line-height Property

10.3. line-height Property

The line-height property is designed to allow a Web author to set the distance between lines of text on a Web page. Using this property, you can space out the text that appears on your Web page, creating effects like “double spacing.” It can take one of three sets of values: the default normal value (equivalent to “single spacing”), a specific height value using a measurement value, or a percentage value relative to the font's height. The line-height property can take any unit of measurement that has been allotted to CSS (see the CSS Units chapter for more detailed information on which units of measure can be used).

It is best to use the line-height property in conjunction with the font-size property. That way, you can simply set the exact size for the font of the text to be displayed, and precisely control the amount of vertical line spacing for that text. For example, if you want a “double-spacing” effect, you set a value for font-size, and then simply double that value for line-height to get the intended effect. You can see code for that effect in Listing 10.3, whose results are displayed in Figure 10-3.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint