22.06.2015 Views

Step by Step HTML5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Controlling Image Size and Padding 149<br />

1. Examine the document in Internet Explorer. Notice the placement of the text in<br />

relation to the graphic.<br />

2. In Notepad, add a clear style rule to the tag near the top:<br />

<br />

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

The horizontal line, and everything that follows it, appears below the graphic.<br />

CLEAN UP Close the Notepad and Internet Explorer windows.<br />

Of course, this isn’t a look that you would want to keep, because there’s too much white<br />

space around the graphic. But in the next exercise, you will learn how to specify the<br />

graphic’s size to fix that.<br />

Controlling Image Size and Padding<br />

Image size is expressed in pixels. If you want, you can specify only the width; the height<br />

will be resized proportionally, or vice versa. But you also have the option to specify both<br />

the width and the height. For example, suppose the following is your original image,<br />

which is 150 pixels high:

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

Saved successfully!

Ooh no, something went wrong!