css摺疊樣式(3)——常用樣式屬性

來源:互聯網
上載者:User

標籤:css常用樣式屬性、css


一、顏色屬性

650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/84/15/wKiom1eE-0GiiLGlAAA-1Idd4os028.png" title="5.png" alt="wKiom1eE-0GiiLGlAAA-1Idd4os028.png" />


demo.html

<!doctype html><html>    <head>        <title>CSS的顏色屬性的四種方式</title>        <meta charset="utf-8">        <style type="text/css">            body{                color:red            }            .c1{                color:#ff6600            }                    .c2{                color:rgb(0,0,255)  /* 紅(R)、綠(G)、藍(B) 每個的取值範圍0~255 */            }                    .c3{                color:rgba(0,100,0,0.4)    /* RGBA是代表Red(紅色) Green(綠色) Blue(藍色)和 Alpha的(色彩空間)透明度(0-1) */            }        </style>    </head>    <body>        <p>這是第一種方式</p>        <p class="c1">這是第二種方式</p>        <p class="c2">這是第三種方式</p>        <p class="c3">這是第四種方式</p>    </body></html>


二、字型屬性

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/84/15/wKioL1eE--LwDduuAAA9NosEXC8230.png" title="6.png" alt="wKioL1eE--LwDduuAAA9NosEXC8230.png" />


demo.html

<!doctype html><html>    <head>        <title>CSS的字型屬性</title>        <meta charset="utf-8">        <link rel="stylesheet" type="text/css" href="style.css">    </head>    <body>        <p class="c1">字型大小20px</p>        <p class="c2">楷體</p>        <p class="c3">加粗</p>        <p class="c4">斜體</p>            </body></html>


style.css

p.c1{        font-size:50px}p.c2{        font-family:KaiTi,SimSun    /* 可以使用“,”隔開,以確保當字型不存在的時候直接使用下一個 */}p.c3{        font-weight:bold           /* font-weight 字型加粗,normal(預設值)、bold(粗)、bolder(更粗)、lighter(更細) */                              /*另外一種方式:100、200、300~900,400 = normal,而 700 = bold,只能整百 */}    p.c4{        font-style:italic    /* normal:標準 italic:斜體 oblique:傾斜 inherit:繼承  */}


本文出自 “發酸的牛奶” 部落格,轉載請與作者聯絡!

css摺疊樣式(3)——常用樣式屬性

聯繫我們

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