css基礎:樣式屬性

來源:互聯網
上載者:User

標籤:ima   序號   isp   左右   高度   顯示   顏色   image   osi   

1.背景與前景:background-color:;背景色,樣式表優先順序高。

background-image:url(路徑);設定背景圖片

background-attachment:fixed;背景固定,不隨字型滾動。scroll;背景隨字型滾動。

background-repeat:no-repeat;不平鋪。repeat;平鋪。repeat-x;橫向平鋪。repeat-y;縱向平鋪。

background-position:center 背景圖置中,設定背景圖時,top 上,left 左,right 右,repeat必須為no-repeat

background-position:left 100px top 200px;離左邊100像素,離上邊200像素。

2.字型:font-famliy:"新宋體";

font-size:12px; 字型大小,需要加單位

font-weight:bold; 加粗,normal為正常。

font-style:italic; 斜體,normal不傾斜

color:#000000; 字型顏色

text-decoration:underline;底線,overline 上劃線,line-through刪除線,none 去掉底線

text-align:center; 水平置中,left 靠左對齊,right 靠右對齊

vertical-align:middle; 垂直對齊,top 頂部對齊,bottom 底部對齊

text-indent:28px; 首行縮排量

line-height:24px; 行高,一般為1.5~2倍字型大小。

display:none; 不顯示,inline-block 顯示為塊,不自動換行,高度可設。

visibility:hidden;可視性:隱藏,占空間;visible 顯示。

3.邊界和邊框:border 邊框線,margin 外邊距,padding 內邊距。

border:5px solid black;四邊框,5像素寬,實線,黑色。border-top 上邊框;bottom 下邊框;left 左;right 右。

margin:10px;四面邊框外寬度為10px;auto 置中;margin-top 頂部邊框外為10px;margin:20px 0px 10px 5px  上-右-下-左邊框外寬度分別為20,0,10,5px。

padding:10px:四面邊框內寬度為10px;上下左右同上。

3.列表與方塊:width、height、(top、bottom、left、right)只有在絕對座標情況下才有用。

list-style:none;取消列表序號;circle 序號變為圓圈,樣式相當於無序。

list-style-image:url(圖片地址);圖片作為序號。

list-style-position:outside;序號在內容外;inside 序號跟內容在一起。

css基礎:樣式屬性

聯繫我們

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