<ul><liclass="first done">Create an HTML document</li><liclass="second done">Create a CSS style sheet</li><liclass="third">Link them all together</li></ul>
/* The element with the class "first" is bolded */.first{
font-weight: bold;
}/* All the elements with the class "done" are strike through */.done{
text-decoration: line-through;
}
3、ID选择器(ID在页面上应该唯一)
<pid="world"> — "Hello World!"</p><pid="mybf"> — "Hello My Boyfriend~"</p>
<ul><li><ahref="https://developer.mozilla.org/en-US/docs/Glossary/CSS">CSS</a> defined in the MDN glossary.</li><li><ahref="https://developer.mozilla.org/en-US/docs/Glossary/HTML">HTML</a> defined in the MDN glossary.</li></ul>