You are on page 1of 2

More about Selectors

Elements <h1> </h1> h1 {


<p>The Blog Post</p> color: red;
Set equal style for <div>More Info</div> }
these elements

Classes <h1 class="blog-post"> .blog-post {


</h1> color: red;
Set equal style for <p class="blog-post"> }
elements within the </p>
same class <div class="blog-post">
</div>

Universal <h1> </h1> * {


<p class="blog-post"> color: red; s one!
use thi
</p> } ly
Rare
More about Selectors

IDs #main-title {
<h1 id="main-title">
color: red;
Set style to one </h1>
}
specific element

Attributes <button disabled> [disabled] {


color: red;
Set equal styles to all </button> }
elements with
attribute(s)

You might also like