html樣式表

來源:互聯網
上載者:User

標籤:

@charset "utf-8";/* CSS Document */*/*所有標籤起作用,邊距和間距都設為0px*/{    margin:0px;    padding:0px;}p,span   /*直接寫個標籤名字,表示所有的p標籤都執行這個樣式*/{    background-color:#F6C;    color:#0F0;}p.sp{    background-color:#FF0;    color:red;    font-size:36px;}.main/*以.開頭,使用class引用此樣式表*/{    height:50px;    width:300px;    background-color:#0FF;    font-size:45px;}.main p/*表示使用class=main的標籤內若有p標籤,執行此樣式*/{    width:400px;    font-size:36px;}#main/*以#開頭,使用id選取器引用此樣式表*/{    height:60px;    width:500px;    background-color:#60C;    font-size:36px;}a:link

通過樣式表,我們可以控制html中顯示的字型大小,格式,顏色等

<style type="text/css"></style><link href="Untitled-1.css" rel="stylesheet" type="text/css" /></head><body><div style="background-color:#0F0">1234567</div><p>春天來了。</p><p>花兒開了,草兒綠了。</p><p class="sp">鵝鵝鵝,曲項向天歌。</p><span class="main">鋤禾日當午<p>汗滴禾下土</p></span><p class="main">白日依山盡</p><p id="main" >床前明月光</p><span>疑是地上霜</span><br /><a href="http://www.baidu.com/">百度一下</a></body></html>

我們在html的標籤裡引用上樣式表,即為效果

div預設佔用一行,而span則是用多少佔用多少

 

 

 

html樣式表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.