Exit tutorial


HTML Tutorial
Cascading Style Sheet Tutorials
Setting A Line Height

There is a way to control the space between lines of text.

You can set the line height for paragraphs with a little CSS in the head section of your HTML document, like this:

<style type="text/css">
<!--
P {line-height : 20px;}
-->
</style>

As you can see in this paragraph, it does work. There are no extra <br> or <p> tags to space these lines farther apart. Just change the 20px to however many pixels you need it to be. The comment tags should be included to older browsers from displaying the code.

If you're wondering how to make one paragraph with a line height that is spread apart farther than normal and another with lines that crowd together, yet also have normal paragraphs all on the page - ; it's by creating a class of tags. Go through the 3-part Introduction to CSS to see how to do that.

[Back to the Stage 6 Index]