Line Height

CSS provides the ability to adjust the line height between lines of text. In other words, when creating a web page or blog, you can specify the space between each line of text. In desktop publishing circles, this is known as "leading". This article shows you how to adjust the line height in your HTML documents.

To adjust the line height of your text, you need to use the CSS line-height property. The value that you provide determines the line height - the space between each line.

Below are some examples using different values for the line-height property.

Line Height Examples

Here are examples of the different value types that you can specify on the line-height property. For example, if you write line-height:30px, you are specifying that the line height should be 30 pixels.

Source CodeResult

Normal text: This text does not have its line height specified. Therefore it uses a default value.

Adjusted line-height: This text has got a line-height value of 30 pixels.

Adjusted line-height: This text has got a line-height value of 1.5em.

Adjusted line-height: This text has got a line-height value of 130 percent.

Adjusted line-height: This text has got a line-height value of 2.8.

About the HTML Codes

The HTML code on this page is provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

External Style Sheets

Most of the HTML codes on this website use inline CSS. If you intend to use the codes across your whole website, you should place the CSS into an external style sheet.

To learn more, check out this explanation of external style sheets.

Web Hosting

Our partner site, ZappyHost, is a professional web hosting company providing website hosting, domain names and related products. If you need web hosting, check them out!