【代码笔记】Web-CSS-CSS Fonts(字体)

一,效果图。

 

二,代码。

 

复制代码
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CSS Fonts(字体)</title>
    <style>
    body {
        font-size: 100%;
    }
    
    h1 {
        font-style: normal;
        font-size: 40px;
        font-size: 2.5em;
    }
    
    p.serif {
        font-family: "Times New Roman", Times, serif;
        font-style: italic;
        font-size: 30px;
        font-size: 1.875em;
    }
    
    p.sansserif {
        font-family: Arial, Helvetica, sans-serif;
        font-style: oblique;
        font-size: 14px;
        font-size: 0.875em;
    }
    </style>
</head>

<body>
    <h1>css font-family</h1>
    <p class="serif">this is a paragrapth,shown in the times new Roman font.</p>
    <p class="sansserif">this is a paragraph,shown in the arial font.</p>
</body>

</html>
复制代码

 

参考资料:《菜鸟教程》

posted @ 2019-01-17 09:09  花儿迎风笑  阅读(315)  评论(0编辑  收藏  举报