10.07.2017 Views

246996016-HTML5-Step-by-Step

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

136 Chapter 8<br />

Notice that the justify option aligns all lines of the paragraph (except the last one) at<br />

both the right and left. The last line of a justified paragraph is always left-aligned. Justified<br />

text can sometimes result in awkwardly spaced lines, especially when the text column<br />

is fairly narrow, such as in the following example:<br />

On a full-size Web page, justified paragraphs should not be a problem, because there is<br />

enough text to ensure even spacing. However, when you start working with table-based<br />

or division-based page layouts (such as those presented in Part 3 of this book) you might<br />

have some narrow columns of text like the one in the previous example. Avoid using<br />

justified alignment for text in narrow columns whenever possible.<br />

In this exercise, you will change the alignment of certain elements <strong>by</strong> editing the embedded<br />

style sheet.<br />

SET UP Use the spray.htm file in the practice file folder for this topic. This file is<br />

located in the Documents\Microsoft Press\<strong>HTML5</strong> SBS\08Paragraphs\Indenting<br />

folder. Open the spray file in Notepad and in Internet Explorer.<br />

1. In the area, create the following style rule:<br />

h1, h2, {text-align: center}<br />

2. Save the file, and then refresh the Internet Explorer display.<br />

3. Change the style definition for the tag to use justified alignment.<br />

p {text-indent: 20px; padding-left: 20px; text-indent: 20px; text-align:<br />

justify}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!