22.06.2015 Views

o_19octlt3v29m1ul81r9513q81i4ra.pdf

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

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

150 Chapter 9<br />

You could add a height=”75” attribute to the tag, without specifying a width, like<br />

this:<br />

<br />

When you view the page, the image shrinks proportionally, like this:<br />

However, if you specify both height and width of 75, like this:<br />

<br />

The image will be distorted, like this:<br />

Like text, images can have margins and/or padding to separate them from surrounding<br />

elements. For example, in the example just shown, notice how close the text is to the<br />

graphic. It would be better if the text were moved slightly to the right.<br />

As you learned in Chapter 8, “Formatting Paragraphs by Using Style Sheets,” the padding<br />

attribute controls the space around content, on the inside of the element, and the margin<br />

attribute controls the space surrounding the element. You can use either attribute for an<br />

image. When the image has a border, however, it is better to use the margin attribute.<br />

To increase the space around the example, you can insert a right margin specification<br />

within the style rule, like this:<br />

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

Saved successfully!

Ooh no, something went wrong!