Share this Page URL

Glossary > Glossary - Pg. 260

SUNDAY AFTERNOON Working with Styles 261 Assigning a Class Selector with the SPAN Element You can also create styles that are only applied to SPAN elements that belong to a specific class. For instance, add a CLASS attribute to the SPAN element that you added earlier: <h1><span class="first">Egg</span> Facts and Figures</h1> Next, edit the style rule you created earlier for the SPAN element so it uses a class selector, by appending the class name following a period: span.first { color: green; background: transparent; font-size: 1.3em; font-family: "Comic Sans MS", Geneva, sans-serif; } Now, the style properties will only be applied to SPAN elements that contain a class="first" attribute. You can now create as many more