class特性

每个HTML元素都可以附带一个class特性。有时候,你希望有一种方法可以指定多个元素并将这些元素和页面上的其他元素区分出来,而不是单独指定文档中的某个元素。

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>TODO write content</div>
        <p class="important">例如,你想把几个包含重要信息的段落从其他段落中区分出来</p>
        <p>或者你可能想把指向外站内页面的链接区别开</p>
        <p class="important admittance">为此,你可以使用class特性。</p>
    </body>
</html>
原文地址:https://www.cnblogs.com/q2546/p/9394937.html