DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> WEB網站前端 >> 前端技巧
CSS 常用屬性速查:背景、文字、字體、清單、表格與邊框
編輯:前端技巧     

把每天會用到的屬性整理成一份清單,寫樣式時翻一下就能對齊語法。

背景

background: #00ffee;              /* 背景色 */
background-image: url(*.jpg);    /* 背景圖 */
background-repeat: repeat-x;     /* 水平重複 */
background-attachment: fixed;    /* 不隨內容滾動 */

文字

text-indent: 5em;              /* 首行縮排 */
text-transform: uppercase;       /* 大小寫轉換:uppercase / lowercase / capitalize */
text-decoration: none;           /* underline / overline / line-through / blink */
white-space: normal;             /* pre 可保留空白與換行 */
color: #eeffee;
line-height: 30px;

字體

font-family: Georgia;            /* 字型系列 */
font-style: normal;              /* italic 斜體、oblique 傾斜 */
font-weight: normal;             /* bold 或 100~900 數值 */
font-size: 16px;
font-variant: small-caps;        /* 小型大寫字母 */

清單

有序清單可用 decimal、decimal-leading-zero、lower-roman、upper-roman、lower-alpha、upper-alpha;無序清單則有 disc、circle、square。

表格

border-collapse: collapse;   /* 合併相鄰框線 */
border: 1px solid black;
width: 100%;
height: 50px;
text-align: right;           /* 水平對齊 */
vertical-align: bottom;      /* 垂直對齊 */
padding: 15px;
color: white;
background-color: green;

邊框與輪廓

outline: #00ff00 dotted thick;   /* 輪廓:顏色 / 樣式 / 寬度 */
border: blue solid thin;         /* 邊框:顏色 / 樣式 / 寬度 */

兩者常被搞混:border 會佔據版面並參與盒模型計算,outline 則繪製在元素之外、不影響布局,因此很適合拿來做焦點提示樣式。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved