O'Reilly logo

Absolute Beginner's Guide to Programming, Third Edition by Greg Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simple HTML Text Formatting

When you want text to appear on the browser's screen, you enter the text inside the HTML code. Your Web page body could simply include lines of text like this:

<body>
This text will appear
on whatever Web browser screen
opens this HTML code.
</body>

Web browsers do not automatically format text. These three lines of text all appear on one line inside the browser, like this:

This text will appear on whatever Web browser screen opens this HTML code.

If you want to add line breaks, you must include the <br> tag (no ending <br> tag exists). <br> tells the Web browser to break the line at that point and move to the next line. The following <body> section displays three lines of text:

 <body> This text will appear<br> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required