Latest web development tutorials
×

CSS Reference Manual

CSS Reference Manual CSS Selector CSS Voice Reference CSS Web Secure Font CSS Animation CSS unit CSS Colour CSS Legal color values CSS The color name CSS Color Hexadecimal value CSS Browser support

CSS Attributes

align-content align-items align-self all animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-align box-direction box-flex box-flex-group box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing caption-side clear clip color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cursor direction display empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font @font-face font-family font-size font-size-adjust font-stretch font-style font-variant font-weight grid-columns grid-rows hanging-punctuation height icon justify-content @keyframes left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top max-height max-width @media min-height min-width nav-down nav-index nav-left nav-right nav-up opacity order outline outline-color outline-offset outline-style outline-width overflow overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before page-break-inside perspective perspective-origin position punctuation-trim quotes resize right rotation tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-justify text-outline text-overflow text-shadow text-transform text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility white-space width word-break word-spacing word-wrap z-index

CSS Reference

Note This tutorial CSS Reference in all major browsers tested.


CSS properties

CSS Property Group:

"CSS" column indicates in which CSS version the property is defined (CSS1, CSS2, or CSS3).

Animation properties

属性 描述 CSS
@keyframes 定义一个动画,@keyframes定义的动画名称用来被animation-name所使用。 3
animation 复合属性。检索或设置对象所应用的动画特效。 3
animation-name 检索或设置对象所应用的动画名称 ,必须与规则@keyframes配合使用,因为动画名称由@keyframes定义 3
animation-duration 检索或设置对象动画的持续时间 3
animation-timing-function 检索或设置对象动画的过渡类型 3
animation-delay 检索或设置对象动画的延迟时间 3
animation-iteration-count 检索或设置对象动画的循环次数 3
animation-direction 检索或设置对象动画在循环中是否反向运动 3
animation-play-state 检索或设置对象动画的状态 3

Background Properties

属性 描述 CSS
background 复合属性。设置对象的背景特性。 1
background-attachment 设置或检索背景图像是随对象内容滚动还是固定的。必须先指定background-image属性。 1
background-color 设置或检索对象的背景颜色。 1
background-image 设置或检索对象的背景图像。 1
background-position 设置或检索对象的背景图像位置。必须先指定background-image属性。 1
background-repeat 设置或检索对象的背景图像如何铺排填充。必须先指定background-image属性。 1
background-clip 指定对象的背景图像向外裁剪的区域。 3
background-origin S设置或检索对象的背景图像计算background-position时的参考原点(位置)。 3
background-size 检索或设置对象的背景图像的尺寸大小。 3

Border (Border) and outline (Outline) property

属性 描述 CSS
border 复合属性。设置对象边框的特性。 1
border-bottom 复合属性。设置对象底部边框的特性。 1
border-bottom-color 设置或检索对象的底部边框颜色。 1
border-bottom-style 设置或检索对象的底部边框样式。 1
border-bottom-width 设置或检索对象的底部边框宽度。 1
border-color 置或检索对象的边框颜色。 1
border-left 复合属性。设置对象左边边框的特性。 1
border-left-color 设置或检索对象的左边边框颜色。 1
border-left-style 设置或检索对象的左边边框样式。 1
border-left-width 设置或检索对象的左边边框宽度。 1
border-right 复合属性。设置对象右边边框的特性。 1
border-right-color 设置或检索对象的右边边框颜色。 1
border-right-style 设置或检索对象的右边边框样式。 1
border-right-width 设置或检索对象的右边边框宽度。 1
border-style 设置或检索对象的边框样式。 1
border-top 复合属性。设置对象顶部边框的特性。 1
border-top-color 设置或检索对象的顶部边框颜色 1
border-top-style 设置或检索对象的顶部边框样式。 1
border-top-width 设置或检索对象的顶部边框宽度。 1
border-width 设置或检索对象的边框宽度。 1
outline 复合属性。设置或检索对象外的线条轮廓。 2
outline-color 设置或检索对象外的线条轮廓的颜色。 2
outline-style 设置或检索对象外的线条轮廓的样式。 2
outline-width 设置或检索对象外的线条轮廓的宽度。 2
border-bottom-left-radius 设置或检索对象的左下角圆角边框。提供2个参数,2个参数以空格分隔,每个参数允许设置1个参数值,第1个参数表示水平半径,第2个参数表示垂直半径,如第2个参数省略,则默认等于第1个参数 3
border-bottom-right-radius 设置或检索对象的右下角圆角边框。 3
border-image 设置或检索对象的边框样式使用图像来填充。 3
border-image-outset 规定边框图像超过边框的量。 3
border-image-repeat 规定图像边框是否应该被重复(repeated)、拉伸(stretched)或铺满(rounded)。 3
border-image-slice 规定图像边框的向内偏移。 3
border-image-source 规定要使用的图像,代替 border-style 属性中设置的边框样式。 3
border-image-width 规定图像边框的宽度。 3
border-radius 设置或检索对象使用圆角边框。 3
border-top-left-radius 定义左上角边框的形状。 3
border-top-right-radius 定义右下角边框的形状。 3
box-decoration-break 规定行内元素被折行 3
box-shadow 向方框添加一个或多个阴影。 3

Box (Box) property

属性 描述 CSS
overflow-x 如果内容溢出了元素内容区域,是否对内容的左/右边缘进行裁剪。 3
overflow-y 如果内容溢出了元素内容区域,是否对内容的上/下边缘进行裁剪。 3
overflow-style 规定溢出元素的首选滚动方法。 3
rotation 围绕由 rotation-point 属性定义的点对元素进行旋转。 3
rotation-point 定义距离上左边框边缘的偏移点。 3

Color (Color) properties

属性 描述 CSS
color-profile 允许使用源的颜色配置文件的默认以外的规范 3
opacity 设置一个元素的透明度级别 3
rendering-intent 允许超过默认颜色配置文件渲染意向的其他规范 3

Padding (Padding) Property

Attributes Explanation CSS
padding Set all padding properties in one declaration 1
padding-bottom Set the bottom padding element 1
padding-left The element of the left padding 1
padding-right Element is set right padding 1
padding-top Settings at the top elements to fill 1

Media Properties page content

属性 说明 CSS
bookmark-label 指定书签的标签 3
bookmark-level 指定了书签级别 3
bookmark-target 指定了书签链接的目标 3
float-offset 在相反的方向推动浮动元素,他们一直具有浮动 3
hyphenate-after 指定一个断字的单词断字字符后的最少字符数 3
hyphenate-before 指定一个断字的单词断字字符前的最少字符数 3
hyphenate-character 指定了当一个断字发生时,要显示的字符串 3
hyphenate-lines 表示连续断字的行在元素的最大数目 3
hyphenate-resource 外部资源指定一个逗号分隔的列表,可以帮助确定浏览器的断字点 3
hyphens 设置如何分割单词以改善该段的布局 3
image-resolution 指定了正确的图像分辨率 3
marks 将crop and/or cross标志添加到文档 3
string-set   3

Size (Dimension) property

属性 描述 CSS
height 设置元素的高度 1
max-height 设置元素的最大高度 2
max-width 设置元素的最大宽度 2
min-height 设置元素的最小高度 2
min-width 设置元素的最小宽度 2
width 设置元素的宽度 1

Flexible Box Model (Flexible Box) property (new)

属性 说明 CSS
flex 复合属性。设置或检索弹性盒模型对象的子元素如何分配空间。 3
flex-grow 设置或检索弹性盒的扩展比率。 3
flex-shrink 设置或检索弹性盒的收缩比率。 3
flex-basis 设置或检索弹性盒伸缩基准值。 3
flex-flow 复合属性。设置或检索弹性盒模型对象的子元素排列方式。 3
flex-direction 该属性通过定义flex容器的主轴方向来决定felx子项在flex容器中的位置。 3
flex-wrap 该属性控制flex容器是单行或者多行,同时横轴的方向决定了新行堆叠的方向。 3
align-content 在弹性容器内的各项没有占用交叉轴上所有可用的空间时对齐容器内的各项(垂直)。 3
align-items 定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 3
align-self 定义flex子项单独在侧轴(纵轴)方向上的对齐方式。 3
justify-content 设置或检索弹性盒子元素在主轴(横轴)方向上的对齐方式。 3
order 设置或检索弹性盒模型对象的子元素出现的順序。 3

Flexible Box Model (Flexible Box) property (old)

Attributes Explanation CSS
box-align Specifies how to align a block of sub-elements 3
box-direction In which direction is specified, it displays a box child element 3
box-flex Specify whether a box of sub-elements are flexible or fixed size 3
box-flex-group Flexible elements assigned to Flex Group 3
box-lines Whenever it runs in the space of the parent frame when a further specify whether a new row 3
box-ordinal-group A frame display order of sub-elements 3
box-orient Specifies whether a box of a child element in the horizontal or vertical direction should be laid 3
box-pack Specifies lateral box in a horizontal position and vertical position of the vertical frame 3

Font (Font) Property

Attributes Explanation CSS
font Set all font properties in one declaration 1
font-family The provisions of the text font family 1
font-size The provisions of the text font size 1
font-style Font styles specified text 1
font-variant Font styles specified text 1
font-weight Prescribed font weight 1
@ font-face A rule that allows the site to download and use other than "Web- safe" for the font 3
font-size-adjust The elements aspect predetermined value 3
font-stretch Shrink or stretch the current font family 3

Content generation attribute (Generated Content Properties)

Attributes Explanation CSS
content With: before and: after pseudo-element used in conjunction to insert generated content 2
counter-increment Increment or decrement one or more counters 2
counter-reset Create one or more counters or reset 2
quotes Set of nested types referenced quotes 2
crop Allow replaced elements just as an object instead of the rectangular area of ​​the entire object 3
move-to Causes an element to be removed from the flow and reinserted at a later point in the document 3
page-policy String value is determined based on the page to apply to a given element in the counter 3

Grid (Grid) property

Attributes Explanation CSS
grid-columns Specifies the width of each column in the grid 3
grid-rows Specifies the height of each column in the grid 3

Hyperlink (Hyperlink) Properties

Attributes Explanation CSS
target Shorthand property to set target-name, target-new, and the target-position property 3
target-name Specifies to open the link (destination) where 3
target-new Specifies whether a new target link opens a new window or open a new tab in an existing window 3
target-position Specify the new destination links should be placed in the position 3

Wireframe (Linebox) property

Attributes Explanation CSS
alignment-adjust Allows more precise alignment of elements 3
alignment-baseline Its parent element specified inline level how to align 3
baseline-shift Allows repositioning of the dominant-baseline relative to the dominant-baseline 3
dominant-baseline Specifies the scaled-baseline-table 3
drop-initial-after-adjust Set the initial alignment point pulldown primary connection point 3
drop-initial-after-align Set the calibration line within the initial line is that it has the first letter of the box using the primary connection point 3
drop-initial-before-adjust Settings drop-down auxiliary connection point initial alignment point 3
drop-initial-before-align Set the calibration line within the initial line is that it has the first letter of the auxiliary junction box 3
drop-initial-size The first letter of the control of local subsidence 3
drop-initial-value Activate a drop-down initial results 3
inline-box-align Set up a multi-line inline block row having aligned front and next inline elements 3
line-stacking A set line-stacking-strategy, line-stacking-ruby, and line-stacking-shift attribute shorthand property 3
line-stacking-ruby Sets the line stacking method for block elements containing Ruby annotation elements 3
line-stacking-shift Set base-shift line containing stacked block element method element 3
line-stacking-strategy Stacking method sets contained within the block elements of the stack frame 3
text-height Text area inline box set block-progression dimension 3

List (List) property

Attributes Explanation CSS
list-style Set up a list of all the properties in one declaration 1
list-style-image The picture as a list-item marker 1
list-style-position Set list item marker placement 1
list-style-type Set the type of list-item marker 1

Margin (Margin) property

Attributes Explanation CSS
margin Set all margin properties in one declaration 1
margin-bottom Element is set lower margin 1
margin-left The element in the left margin 1
margin-right The element of the right margin 1
margin-top Element is set on the margin 1

Subtitles (Marquee) property

Attributes Explanation CSS
marquee-direction Setting the direction of moving content 3
marquee-play-count How many times have set up mobile content 3
marquee-speed Set how fast scroll content 3
marquee-style Styling mobile content 3

Multiple columns (Multi-column) property

Attributes Explanation CSS
column-count The number of columns specified element should be divided into the 3
column-fill Specifies how to fill columns 3
column-gap Specified gap between the columns 3
column-rule All set for column-rule- * properties shorthand property 3
column-rule-color Specify color rules between columns 3
column-rule-style Style rule specifies between columns 3
column-rule-width Specifies the width of the rule between columns 3
column-span How many columns specified element should span 3
column-width Specifies the width of the columns 3
columns Shorthand property to set the number of columns and column width 3

Page Media (Paged Media) property

Attributes miss CSS
fit If the width and height attributes are not auto gives a hint of how massive replaced elements 3
fit-position Determining the alignment of the object inside the box 3
image-orientation Specifies the user-agent suitable for right or rotate the image clockwise 3
page Specify a particular type of element should display a page 3
size Specify the content of the page containing the BOX size and orientation 3

Positioning (Positioning) property

Attributes Explanation CSS
bottom Offset block at the border between the lower margin settings targeting elements comprising its border 2
clear Which side of the predetermined element prevents other floating elements 1
clip Cut absolutely positioned elements 2
cursor Type cursor provisions to be displayed (shape) 2
display Type specifies the elements to be generated box 1
float Are the provisions of box should float 1
left Setting targeting elements comprising its border left margin offset between the left edge of the block 2
overflow
What happens when the contents of the provisions of the overflow box element 2
position Location type specifies the elements 2
right Setting the right margin positioning elements containing an offset block border and its right border between 2
top Set targeting elements contained on the border and its margin offsets between the block boundary 2
visibility Are the provisions of visible elements 2
z-index Setting the stacking order of elements 2

Paging (Print) property

Attributes Explanation CSS
orphans Minimum number of lines occurs when the internal elements must be retained tab at the bottom of the page 2
page-break-after Settings tab behavioral elements after 2
page-break-before Settings tab behavioral elements before 2
page-break-inside The element inside the tab behavior 2
widows Minimum number of lines occurs when the internal elements must be retained tab at the top of the page 2

Ruby Properties

Attributes Explanation CSS
ruby-align Ruby and Ruby control text based content text alignment relative to each other 3
ruby-overhang When the text exceeds Ruby base Ruby width, determine the local mount any adjacent text ruby ​​text is allowed, in addition to their base 3
ruby-position Where it controls the base text Ruby 3
ruby-span Control over the behavior of annotation elements 3

Speech (Speech) property

Attributes Explanation CSS
mark Set mark-before and mark-after attribute shorthand properties 3
mark-after Allow named tags to the audio stream 3
mark-before Allow named tags to the audio stream 3
phonemes Specifies that contains the text of the corresponding element in a phonetic pronunciation 3
rest Setting a rest-before and rest-after attribute shorthand properties 3
rest-after A content element after the finish, designated to take a break or comply with prosodic boundary 3
rest-before A content element before the finish, designated to take a break or comply with prosodic boundary 3
voice-balance Specified balance the left and right channels 3
voice-duration Specify the contents of the selected element should be taken to render the length of the 3
voice-pitch Specifies the average voice pitch (frequency) 3
voice-pitch-range Specifies the average pitch change 3
voice-rate Speed ​​control 3
voice-stress Indicating efforts focus 3
voice-volume Speech synthesis means that the amplitude of the output waveform 3

Table (Table) property

Attributes Explanation CSS
border-collapse Specifies whether the table border merger 2
border-spacing A predetermined distance between adjacent cell borders 2
caption-side Predetermined location of the title table 2
empty-cells Specifies whether to display borders and background tables in empty cells on 2
table-layout Setting layout algorithm for tables 2

Text (Text) property

Attributes Explanation CSS
color Set the color of the text 1
direction Text predetermined direction / writing direction 2
letter-spacing Setting character spacing 1
line-height Setting row height 1
text-align The horizontal alignment of the provisions of the text 1
text-decoration Provision added to the text of the decorative effect 1
text-indent The provisions of the text block indent the first line 1
text-transform Sensitive controls for the text 1
unicode-bidi 2
vertical-align The vertical alignment of the element 1
white-space How to set a blank control element 1
word-spacing Word spacing settings 1
hanging-punctuation Specifies whether a punctuation mark may be beyond the line box 3
punctuation-trim Specifies whether to remove a punctuation mark 3
text-align-last When text-align is set to justify, the last line alignment. 3
text-justify Decentralized manner specified alignment when text-align is set to justify the time. 3
text-outline Set the outline text. 3
text-overflow Element specifies when the text overflows included, what should happen 3
text-shadow Add a shadow to text 3
text-wrap Rules specify text wrap 3
word-break Specifies line breaking rules for non-CJK text 3
word-wrap Whether to set the browser to be too long a word wrap. 3

2D / 3D transform properties

Attributes Explanation CSS
transform Apply 2D or 3D conversion element 3
transform-origin It allows you to change the position of the conversion element 3
transform-style 3D Space specify how nested elements 3
perspective See how to specify the 3D element is a perspective view 3
perspective-origin 3D elements specify the bottom position 3
backface-visibility Whether the definition of an element should be visible, not in front of the screen 3

Transition (Transition) property

Attributes Explanation CSS
transition This property is a transition-property, transition-duration, transition-timing-function, transition-delay abbreviated form. 3
transition-property Provided for the transition of CSS properties. 3
transition-duration Set the length of time to transition carried out. 3
transition-timing-function Set the transition timing function performed. 3
transition-delay Specifies the transition begins. 3

The appearance of the user (User-interface) properties

Attributes Explanation CSS
appearance Exterior style definition elements 3
box-sizing It allows you to adapt the region to somehow define certain elements 3
icon Specify an icon for the element 3
nav-down Specifies the user presses the down navigation key downward position 3
nav-index Specifies Navigation (tab) order. 3
nav-left Specify when the user presses the button to the left to navigate location 3
nav-right Specifies the user to press the right position when the left navigation 3
nav-up Specifies the user presses the up key navigate up a position 3
outline-offset Setting the offset contour edge outside the framework of the border 3
resize Whether the definition of the elements can be resized 3