欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

html如何設(shè)置字體-創(chuàng)新互聯(lián)

這篇文章主要介紹html如何設(shè)置字體,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

創(chuàng)新互聯(lián)是一家以網(wǎng)站設(shè)計建設(shè),重慶小程序開發(fā)、網(wǎng)站開發(fā)設(shè)計,網(wǎng)絡(luò)軟件產(chǎn)品開發(fā),企業(yè)互聯(lián)網(wǎng)推廣服務(wù)為主的民營科技公司。主要業(yè)務(wù)涵蓋:為客戶提供網(wǎng)站策劃、網(wǎng)站設(shè)計、網(wǎng)站開發(fā)、域名與空間、網(wǎng)站優(yōu)化排名、買友情鏈接等服務(wù)領(lǐng)域。憑借建站老客戶口碑做市場,建設(shè)網(wǎng)站時,根據(jù)市場搜索規(guī)律和搜索引擎的排名收錄規(guī)律編程,全力為建站客戶設(shè)計制作排名好的網(wǎng)站,深受老客戶認(rèn)可和贊譽(yù)。

在HTML網(wǎng)頁設(shè)計中,字體樣式的設(shè)置是最為基礎(chǔ)的。網(wǎng)頁中設(shè)置合適的字體,可以提高用戶體驗(yàn)。那么字體的設(shè)置主要用到css中font-family和font-style等字體相關(guān)屬性。

html如何設(shè)置字體

下面給大家介紹幾種常見的HTML字體樣式!

代碼示例:

<!DOCTYPE>
<html>
<meta charset="utf-8">
<head>
    <title></title>
    <style type="text/css">
        h3 { color: green; }

        #p1 { font-family: Times, "Times New Roman", serif; }
        #p2 { font-family: Helvetica, Arial, sans-serif; }
        #p3 { font-family: serif; }
        #p4 { font-family: sans-serif; }
        #p5 { font-family: monospace; }
        #p6 { font-family: cursive; }
        #p7 { font-family: fantasy; }

        .s1 { font-style: italic; }
        .s2 { font-style: oblique; }
        .s3 { font-weight: bold; }
        .s4 { font-weight: 100; }
        .s5 { font-style: normal;}
    </style>

</head>
<body>
<h2>字體系列</h2>
<p>與CSS一起使用。兩個常見的字體組合列表和五個通用后備字體系列。</p>
一個serif字體家族列表!
<h3>font-family: Times, "Times New Roman", serif</h3>
<p id="p1">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
一個sans-serif字體家族列表!
<h3>font-family: Helvetica, Arial, sans-serif</h3>
<p id="p2">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
serif通用字體系列!
<h3>font-family: serif</h3>
<p id="p3">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
sans-serif通用字體系列!
<h3>font-family: sans-serif</h3>
<p id="p4">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
等寬通用字體系列!
<h3>font-family: monospace</h3>
<p id="p5">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
草書字體家族!
<h3>font-family: cursive</h3>
<p id="p6">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為font-weight: 100;</span>
    <span class="s5">正常字體樣式!</span>
</p>
幻想通用字體系列!
<h3>font-family: fantasy</h3>
<p id="p7">
    <span class="s1">斜體字體!</span>
    <span class="s2">字體樣式為font-style: oblique; </span>
    <span class="s3">字體樣式為font-weight: bold;</span>
    <span class="s4">字體樣式為It sucks in with a 100 font-weight!</span>
    <span class="s5">正常字體樣式!</span>
</p>

</body>
</html>

前臺效果如下圖:

html如何設(shè)置字體

html如何設(shè)置字體

font-family規(guī)定元素的字體系列。font-family 可以把多個字體名稱作為一個“回退”系統(tǒng)來保存。如果瀏覽器不支持第一個字體,則會嘗試下一個。也就是說,font-family 屬性的值是用于某個元素的字體族名稱或/及類族名稱的一個優(yōu)先表。瀏覽器會使用它可識別的第一個值。

有兩種類型的字體系列名稱:

指定的系列名稱:具體字體的名稱,比如:"times"、"courier"、"arial"。

通常字體系列名稱:比如:"serif"、"sans-serif"、"cursive"、"fantasy"、"monospace"

提示:使用逗號分割每個值,并始終提供一個類族名稱作為最后的選擇。

注意:使用某種特定的字體系列(Geneva)完全取決于用戶機(jī)器上該字體系列是否可用;這個屬性沒有指示任何字體下載。因此,強(qiáng)烈推薦使用一個通用字體系列名作為后路。

font-style 屬性定義字體的風(fēng)格。該屬性設(shè)置使用斜體、傾斜或正常字體。斜體字體通常定義為字體系列中的一個單獨(dú)的字體。理論上講,用戶代理可以根據(jù)正常字體計算一個斜體字體。

以上是“html如何設(shè)置字體”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道!

當(dāng)前題目:html如何設(shè)置字體-創(chuàng)新互聯(lián)
當(dāng)前地址:http://chinadenli.net/article10/dgpjdo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、標(biāo)簽優(yōu)化、服務(wù)器托管、面包屑導(dǎo)航、用戶體驗(yàn)、動態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)