8. CSS Element Selector

An element selector is the XHTML element to be given style or layout properties. An element selector is defined in CSS using the name of the element.

Example 8.1 Element Selector Usage
<!DOCTYPE PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Element selector</title>
    <style type="text/css">
    div {
        Property:Value;
    }
    </style>
</head>
<body>
    <div>Styled by an element selector.</div>
</body>
</html>
    

In the example above all div elements will have the specified style.