>> English << | Português | По-русскиZVON > Tutorials > CSS tutorial
>> Example 5 << | Prev | Next | Contents

Description

If several elements share the same property, this property can be specified in one place. In this case the definition in curly brackets is preceded by a list of selectors (element names) separated by commas.

>> Case 1 <<
HTML SourceCSS stylesheet

<h2> h2-h2-h2 </h2>
<h3> h3-h3-h3 </h3>
<div> div-div-div </div>
<div>
<b> b-b-b-b </b>
</div>
<div>
<em> em-em-em </em>
</div>
<div>
<strong> strong </strong>
</div>
body {background-color: white; 
      color: black}


h2, h3 {background-color: black; 
        color: white}

b, em, strong   {color: green; }

Browser output