2024年6月7日发(作者:)

CSS 参考手册

CSS背景属性

属性 描述 值

background-color

background-image

background-repeat

background-attachment

background-position

scroll

fixed

color-rgb

color-hex

color-name

transparent

url

none

top left

top center

top right

center left

center center

center right

bottom left

bottom center

bottom right

x-% y-%

x-pos y-pos

repeat

repeat-x

repeat-y

no-repeat

background

简写属性,作用是将背景属性设置在一个声明中。

background-attachment

设置是否背景图像是固定的或随页面其余部分滚动。

background-color

设置元素的背景颜色。

background-image

将图像设置为背景。

background-position

设置背景图像的起始位置。

background-repeat

设置背景图像是否及如何重复。

CSS 边框属性(border)

属性

border

描述

border-width

简写属性。作用是在一个声明中用来设置四个边框的所有属性。

border-style

border-color

border-bottom

border-bottom-color

border-bottom-style

border-bottom-width

简写属性。作用是在一个声明中用来设置底边框的所有属性。

border-style

border-color

设置底边框的颜色。

设置底边框的样式。

border-color

border-style

thin

medium

thick

length

color

border-bottom-width

设置底边框的宽度。

border-color

设置四个边框的颜色,可以设置一到四个颜色。

border-left

border-left-color

border-left-style

border-left-width

border-right

border-right-color

border-right-style

border-right-width

border-style

border-top

border-top-color

border-top-style

border-top-width

border-width

CSS文本属性

属性

color

direction

border-left-width

简写属性。用于在一个声明中设置左边框的所有属性。

border-style

border-color

设置左边框的颜色

border-color

设置左边框的样式。 border-style

thin

设置左边框的宽度。

medium

thick

length

border-right-width

简写属性。将所有用于右边框的属性设置于一个声明中。

border-style

border-color

设置右边框的颜色

border-color

设置右边框的样式

border-style

thin

设置右边框的宽度。

medium

thick

length

none

hidden

dotted

dashed

设置四个边框的样式,可以设置一到四个样式。

solid

double

groove

ridge

inset

outset

border-top-width

简写属性。将所有用于顶边框的属性设置于一个声明中。

border-style

border-color

设置顶边框的颜色。

border-color

设置顶边框的样式。 border-style

thin

设置顶边框的宽度。

medium

thick

length

thin

简写属性。在一个声明中设置四个边框的宽度,可以设置一到四

medium

个值。

thick

length

描述 值

设置文本颜色

color

设置文本方向

ltr

rtl