Home » Web Development » 03 - Basic HTML Tags and Style Sheets
3

Text Style and Line Spacing

How to specify text format, style and spacing in html

Putting line breaks, horizontal dividers, and extra spaces in HTML is fairly straightforward. Each   markup inserts a single non-breaking space between text or other elements in the body of the HTML document. That is, the markup 'two  spaces' will output two spaces next to each other between the words 'two spaces'. HTML interprets one or more empty characters including line breaks as a single space. Let us try to insert two empty lines and draw a horizontal divider after the single line of text in our HTML document.

<body>
Online Florist -
<a href="http://plantanswers.tamu.edu/flowers/flower.html">Flowers</a>
For All Occasions
<br><br><br>
<hr>
</body>

The <br> tag inserts a line break. We used three of these - the first one breaks the line after our text, and the next two insert two blank lines. The <hr> markup inserts a horizontal divider. Don't forget to add the new markup to your copy of florist.html

The following tags are used to achieve common text styles:

The Tags The Effect
<strong>Bold Text</strong> Bold Text
<em>Italic Text</em> Italic Text
<B>Alternative for Bold Text</B> Alternative for Bold Text
<I>Alternative for Italic Text</I> Alternative for Italic Text
<U>Underlined Text</U> Underlined Text