html 类和id
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> .cla1{ background-color: blue; color: red; } span.red{ color: green; } #sec{ color: black; text-align: center; } </style> </head> <body> <!-- class不唯一 --> <div class="cla1"> <h1>this is div_h1</h1> <p>text text</p> </div> <h1>My <span class="red">Important</span> Heading </h1> <!-- id唯一 --> <h1 id="sec">SecondH1</h1> </body> </html>