10.07.2017 Views

246996016-HTML5-Step-by-Step

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

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

Applying a Border to a Paragraph 131<br />

Argument<br />

inset<br />

Example<br />

outset<br />

none<br />

To apply a border style to an individual instance of a tag, use the following:<br />

<br />

To apply the same formatting using a style sheet, specify the following rule:<br />

p {border-style: solid}<br />

Setting Border Padding<br />

A border encloses the element very tightly <strong>by</strong> default. You will usually want to add a little<br />

more spacing. Create the spacing using the padding attribute. To apply padding using a<br />

style sheet, specify the following rule:<br />

p {border-style: solid; padding: 15px}<br />

To apply the same formatting to an individual instance of a tag, use the following:<br />

<br />

Specifying Border Width and Color<br />

By default, a border is black and 4 pixels wide. To change these attributes, use the bordercolor<br />

and border-width attributes. The color can be any basic or extended color name or<br />

any RGB or hexadecimal color number. (See the discussion of color choices in Chapter 4<br />

if you need to review the color options in HTML.) For example, to decrease the border<br />

width and color it blue using a style sheet, write a rule like this:<br />

p {border-style: solid; border-width: 2px; border-color: blue}

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

Saved successfully!

Ooh no, something went wrong!