CSS3學習----選取器、字型

來源:互聯網
上載者:User

標籤:style   blog   color   使用   檔案   2014   



屬性選取器:
[att*=val]{}若att元素屬性值包括val指定字元,則使用該樣式
[att^=val]{}若att元素屬性值開頭字元為val,則使用該樣式
[att&=val]{}若att元素屬性值結尾字元為val,則使用該樣式

例:

<style type="text/css">[id^=section1]{background-color: yellow;}</style>

<div id="section2">示範範例文本2</div><div id="subsection1">示範範例文本1-1</div><div id="subsection2">示範範例文本1-2</div><div id="subsection2-1">示範範例文本2-1</div><div id="subsection2-2">示範範例文本2-2</div>


target選取器:

頁面內href跳轉時,又一次定義目標的屬性


font字型:曾經的版本號碼網頁中應用的特殊字型僅僅有在client有這個字型時候該字型才幹正常顯示,

             而css3支援從server中擷取字型,也就是說你把字型檔放到font目錄,能夠直接通過url使用這個字型

             這一新的變化真的帶來了非常大的便利。例:

@font-face{font-family: WebFont;src:url(‘font/FZJZFW.TTF‘) format("truetype");font-weight: normal;}
article{font-family: WebFont;}

<article><h1>文章內容</h1><p>網頁級內容區塊的本文</p><section><h3>section級內容的本文</h3><p>section級內容區塊的本文</p></section></article>



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.