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.

118 Chapter 7<br />

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

located in the Documents\Microsoft Press\<strong>HTML5</strong> SBS\07Text\CreatingSpan folder.<br />

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

1. Create a span around the company name in each of the list items, and assign a class<br />

called company to each one.<br />

<br />

Sampson & Company All-Natural<br />

Pesticide<br />

Vickers and Vickers Fertilizer<br />

Sticks<br />

Appleton Acres Big Sack of Bulbs,<br />

Tulips<br />

Jackson and Perkins Climbing<br />

Rosebushes<br />

Easton Create-Your-Own Paving Stones<br />

Kit<br />

Appleton Acres Big Sack of Bulbs,<br />

Daffodils<br />

Appleton Acres Big Sack of Bulbs,<br />

Hyacinths<br />

Appleton Acres Big Sack of Bulbs,<br />

Crocuses<br />

Hawthorne Hills Hosta, 3-Pack<br />

Sampson & Company All-Natural<br />

Herbicide<br />

<br />

Tip Use the Clipboard to copy and paste the opening and closing tags to save<br />

time. They are identical for each entry.<br />

Note In the above example, the space following the text in each span is included within<br />

the span. The space could have gone outside of the span instead. If the class applied<br />

to the span specifies a very different font size than used outside the span, the placement<br />

of the space inside versus outside could make a difference in how the text appears<br />

onscreen; in this exercise’s example, it makes no difference.<br />

2. In the section of the document, create a style that defines the company<br />

class as bold, italic, and red.<br />

.company {font-style: italic; font-weight: bold; color: red}<br />

3. Save the file, and then refresh the Internet Explorer display.

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

Saved successfully!

Ooh no, something went wrong!