CSS 属性参考资料表

王朝html/css/js·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

字型

性質名稱

可用值

作用範圍

是否可繼承

%百分比

font-family

[[<family-name> | <generic-family>],]* [<family-name> | <generic-family>]

預設值:依瀏覽器而定

所有元素

不可使用

font-style

normal | italic | oblique

所有元素

不可使用

font-variant

normal | small-caps

所有元素

不可使用

font-weight

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

所有元素

不可使用

font-size

<absolute-size> | <relative-size> | <length> | <percentage>

預設值:medium

所有元素

相對於親元素的字形尺寸

font

(簡寫性質)

[<font-style> || <font-variant> || <font-weight>]? <font-size> [/<line-height>]? <font-family>

預設值:未定義

所有元素

可使用在 <font-size> 與 <line-height> 兩部分

顏色與背景

性質名稱

可用值

作用範圍

是否可繼承

%百分比

color

<color>

預設值:依瀏覽器而定

所有元素

不可使用

background-color

transparent | <color>

所有元素

不可使用

background-image

none | <url>

所有元素

不可使用

background-repeat

repeat | repeat-x | repeat-y | no-repeat

所有元素

不可使用

background-attachment

scroll | fixed

所有元素

不可使用

background-position

[<percentage> | <length>]{1,2} | [top | center | bottom] || [left | center | right]

預設值:0% 0%

區塊等級與替代元素

相對於該元素本身的尺寸大小

background

(簡寫性質)

<background-color> || <background-image> || <background-repeat> || <background-attachment> || <background-position>

預設值:未定義

所有元素

可使用在 <background-

position>

文字

性質名稱

可用值

作用範圍

是否可繼承

%百分比

word-spacing

normal | <length>

所有元素

不可使用

letter-spacing

normal | <length>

所有元素

不可使用

text-decoration

none | [underline || overline || line-through || blink]

預設值:none

所有元素

不可使用

vertical-align

baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage>

行內元素

相對於該元素本身的行高

text-transform

none | capitalize | uppercase | lowercase

所有元素

不可使用

text-align

left | right | center | justify

預設值:依瀏覽器而定

區塊等級元素

不可使用

text-indent

<length> | <percentage>

預設值:0

區塊等級元素

相對於親元素的寬度

line-height

normal | <number> | <length> | <percentage>

所有元素

相對於該元素本身的字型尺寸大小

區塊

性質名稱

可用值

作用範圍

是否可繼承

%百分比

margin-top

<length> | <percentage> | auto

預設值:0

所有元素

相對於親元素的寬度

margin-right

<length> | <percentage> | auto

預設值:0

所有元素

相對於親元素的寬度

margin-bottom

<length> | <percentage> | auto

預設值:0

所有元素

相對於親元素的寬度

margin-left

<length> | <percentage> | auto

預設值:0

所有元素

相對於親元素的寬度

margin

(簡寫性質)

[<length> | <percentage> | auto]{1,4}

預設值:未定義

所有元素

相對於親元素的寬度

padding-top

<length> | <percentage>

預設值:0

所有元素

相對於親元素的寬度

padding-right

<length> | <percentage>

預設值:0

所有元素

相對於親元素的寬度

padding-bottom

<length> | <percentage>

預設值:0

所有元素

相對於親元素的寬度

padding-left

<length> | <percentage>

預設值:0

所有元素

相對於親元素的寬度

padding

[<length> | <percentage>]{1,4}

預設值:0

所有元素

相對於親元素的寬度

border-top-width

medium | thin | thick | <length>

所有元素

不可使用

border-right-width

medium | thin | thick | <length>

所有元素

不可使用

border-bottom-width

medium | thin | thick | <length>

所有元素

不可使用

border-left-width

medium | thin | thick | <length>

所有元素

不可使用

border-width

(簡寫性質)

[thin | medium | thick | <length>]{1,4}

預設值:未定義

所有元素

不可使用

border-color

<color>{1,4}

預設值:「color」性質的值

所有元素

不可使用

border-style

none | dotted | dashed | solid | double | groove | ridge | inset | outset

所有元素

不可使用

border-top

(簡寫性質)

<border-top-width> || <border-style> || <color>

預設值:未定義

所有元素

不可使用

border-right

(簡寫性質)

<border-right-width> || <border-style> || <color>

預設值:未定義

所有元素

不可使用

border-bottom

(簡寫性質)

<border-bottom-width> || <border-style> || <color>

預設值:未定義

所有元素

不可使用

border-left

(簡寫性質)

<border-left-width> || <border-style> || <color>

預設值:未定義

所有元素

不可使用

border

(簡寫性質)

<border-width> || <border-style> || <color>

預設值:未定義

所有元素

不可使用

width

auto | <length> | <percentage>

區塊等級與替代元素

相對於親元素的寬度

height

auto | <length>

區塊等級與替代元素

不可使用

float

none | left | right

所有元素

不可使用

clear

none | left | right | both

所有元素

不可使用

分類

性質名稱

可用值

作用範圍

是否可繼承

%百分比

display

block | inline | list-item | none

所有元素

不可使用

white-space

normal | pre | nowrap

區塊等級元素

不可使用

list-style-type

disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none

所有「display」性質的值是「list-item」的元素

不可使用

list-style-image

none | <url>

所有「display」性質的值是「list-item」的元素

不可使用

list-style-position

outside | inside

所有「display」性質的值是「list-item」的元素

不可使用

list-style

(簡寫性質)

<keyword> || <position> || <url>

預設值:未定義

所有「display」性質的值是「list-item」的元素

不可使用

定位

性質名稱

可用值

作用範圍

是否可繼承

%百分比

position

static | absolute | relative

所有元素

不可使用

left

auto | <length> | <percentage>

所有「position」性質的值是「absolute」或者「relative」的元素

相對於親元素的寬度與高度。如果親元素的高度的值是「auto」,則百分比型式的值視為未定義

top

auto | <length> | <percentage>

所有「position」性質的值是「absolute」或者「relative」的元素

相對於親元素的寬度與高度。如果親元素的高度的值是「auto」,則百分比型式的值視為未定義

z-index

auto | <integer>

所有可定位的元素

不可使用

width

auto | <length> | <percentage>

區塊等級與替代元素,以及所有「position」性質的值是「absolute」的元素

相對於親元素的寬度與高度。如果親元素的高度的值是「auto」,則百分比型式的值視為未定義

height

auto | <length> | <percentage>

區塊等級與替代元素,以及所有「position」性質的值是「absolute」的元素

相對於親元素的寬度與高度。如果親元素的高度的值是「auto」,則百分比型式的值視為未定義

clip

auto | <shape>

所有「position」性質的值是「absolute」的元素

不可使用

overflow

visible | hidden | scroll | auto

所有「position」性質的值是「absolute」的元素

不可使用

visibility

inherit | visible | hidden

所有元素

如果此性質的值是「inherit」,便繼承親元素的值,否則此性質沒有可繼承性

不可使用

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航