派生选择器

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>派生选择器</title>
    <style type="text/css">
        li strong {
            font-style: italic;
            font-weight: normal;
        }
    </style>
</head>
<body>
    <p><strong>我是粗体字,不是斜体字,因为我不在列表当中,所以这个规则对我不起作用</strong></p>
    <ol>
        <li><strong>我是斜体字。这是因为 strong 元素位于 li 元素内。</strong></li>
        <li>我是正常的字体。</li>
    </ol>
</body>
</html>

posted @ 2016-06-28 15:43  Chris_在IT道路上前行  阅读(120)  评论(0编辑  收藏  举报