前提

id > class > 要素 > *  (←をクリックすると他の状態もみられるよ)
このサンプルは「id」の指定が優先されています。

サンプル

テキストの色の指定を見てください。

HTML

<div> <p id="thisId" class="thisClass">テキストの色の指定を見てください。</p> </div>

CSS

#thisId { /* ★★★★★ */ color: green } .thisClass { /* ★★★☆☆ */ color: red; } div p { /* ★★☆☆☆ */ color: blue; } * { /* ★☆☆☆☆ */ color: gray; }