網站範本修改中常用到的CSS代碼詳解

來源:互聯網
上載者:User

仲介交易 HTTP://www.aliyun.com/zixun/aggregation/6858.html">SEO診斷 淘寶客 雲主機 技術大廳

在上一篇文章中,提到了一些修改網站範本中常用到的方法,工具。 但其中也牽涉到不到關於CSS樣式表的一些知識,對於這些知識,缺乏的還占大多數,今天我就將常用的一些CSS樣式表語法整理一下,發出來給大家,希望對各位站長朋友修改網站範本的時候有一些説明。 如果你還沒閱讀過上一篇文章,請先移步至《關於淘客範本修改的一些心得總結》。

CSS樣式表的出現就是為了規範網頁結構,網頁中的所有框架,無一例外的都通過CSS樣式表來定義其樣式,大小、位置,邊框位置等...... 詳見下表:

邊框寬度 : border-width : 5px;

上邊寬度 : border-top-width : 5px;

左邊寬度 : border-left-width : 5px;

右邊寬度 : border-right-width : 5px;

底邊寬度 : border-bottom-width : 5px;

邊框顏色 : border-color : #000000;

上邊顏色 : border-top-color : #000000;

邊框樣式 : border-style : double; 可替換 dashed; dotted; none;

上邊樣式 : border-top-style : solid;

左邊樣式 : border-left-style : inset;

右邊樣式 : border-right-style : ridge;

底邊樣式 : border-bottom-style : solid;

整體寬度 : width : 5px;

整體高度 : height : 5px;

溢出選項 : overflow : visible; 可替換 hidden; scroll; auto;

內側邊距 : padding : 5px;

上內邊距 : padding-top : 5px;

外側邊距 : margin : 5px;

上外邊距 : margin-top : 5px;

文字字體 : font-family : fantasy;

文字大小 : font-size : 12pt;

文字粗細 : font-weight : bold;

文字樣式 : font-style : italic;

文字變數 : line-height : 110%;

清除屬性 : clear : left; 可替換 right; both; none;

浮動屬性 : float : left; 可替換 right; none;

水準排列 : text-align : left; 可替換 right; center; justify;

文本修飾 : text-decoration : underline; 可替換 overline; underline overline; line-through; blink;

文本縮進 : text-indent : 5em;

文字間距 : letter-spacing : 5px;

字母間距 : word-spacing : 5px;

文本轉換 : text-transform : capitalize; 可替換 lowercase; uppercase;

垂直排列 : vertical-align : baseline; 可替換 top; middle; bottom; text-top; text-bottom; super; sub; 3em; 30%;

背景圖片 : background-image : url(tianyi.gif);

背景拉伸 : background-repeat : repeat; 可替換 repeat-x; repeat-y; no-repeat;

背景定位 : background-position : left; 可替換 right; top; left top; right bottom; 30% 50%;

附加屬性 : background-attachment : fixed; 可替換 scroll;

顯示內容 : display : none; 可替換 block; inline; run-in; compact; list-item; marker;

是否可見 : visibility : visible; 可替換 hidden;

資源定位 : position : static; 可替換 relative; absolute; fixed;

距離頂部 : top : 5px;

距離左邊 : left : 5px;

距離右邊 : right : 5px;

距離底邊 : bottom : 5px;

以上就是對於一些常用的CSS語法,然而我們在修改範本的時候用得最多的莫非是 margin-top; margin-left; margin-right; align; background : url(tianyi.gif); border-width : 5px; 這幾個平率最高。

  希望這些代碼多多少少對各位站長朋友們帶來一些幫組,好了,今天的文章就說到這裡。 不懂的還是自己多動手百度百度。 本文來自多彩網 HTTP://www.deluxmart.com,如要轉載文章,請保留網址連結,謝謝!如果你還有什麼問題,可以去我的網站給我留言。

聯繫我們

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