HTML and CSS Reference
In-Depth Information
EXAMPLE 14.16 ( CONTINUED )
<ul class="square">
<li>circle</li>
<li>square</li>
<li>triangle</li>
</ul>
<ul class="none">
<li>Thanks</li>
<li>Tack</li>
<li>Gracias</li>
</ul>
</body>
</html>
EXPLANATION
1
A CSS class is defined for a list with different styles.
2
This is an HTML list item using the “disc” class. The output shown in Figure
14.17.
Figure 14.17 Using a CSS class to create different styles for lists.
14.8 The ID Selector and the ID Attribute
The ID Selector. The ID selector is another way to create a style that is independent
of a specific HTML tag. By using the ID selector, you can choose the style for the element
by assigning it a unique ID. The name of the ID selector is always preceded by a hash
mark (also called a pound sign, #). The declaration block, consisting of properties and
values, follows the ID selector and is enclosed in curly braces.
 
 
Search WWH ::




Custom Search