1、网页设计中的CSS样式代码详解CSS 背景属性属性描述值IEFNW3Cbackground简写属性,作用是将背景属性设置在一个声明中。 background-color background-image background-repeat background-attachment background-position 4161background-attachment背景图像是否固定或者随着页面的其余部分滚动。 scroll fixed 4161background-color设置元素的背景颜色。 color-rgb color-hex color-name transparent 414
2、1background-image把图像设置为背景。 url none 4141background-position设置背景图像的起始位置。 top left top center top right center left center center center right bottom left bottom center bottom right x-% y-% x-pos y-pos 4161background-repeat设置背景图像是否及如何重复。 repeat repeat-x repeat-y no-repeat 4141CSS 边框属性 (border)属性描述值IEF
3、NW3Cborder简写属性。作用是在一个声明中用来设置四个边框的所有属性。 border-width border-style border-color 4141border-bottom简写属性。作用是在一个声明中用来设置下边框的所有属性。 border-bottom-width border-style border-color 4161border-bottom-color设置下边框的颜色。border-color4162border-bottom-style设置下边框的样式。border-style4162border-bottom-width设置下边框的宽度。 thin mediu
4、m thick length 4141border-color设置四个边框的颜色,可以设置一到四个颜色。color4161border-left简写属性。用于在一个声明中设置左边框的所有属性。 border-left-width border-style border-color 4161border-left-color设置左边框的颜色。border-color4162border-left-style设置左边框的样式。border-style4162border-left-width设置左边框的宽度。 thin medium thick length 4141border-right简写属
5、性。将所有用于右边框的属性设置于一个声明中。 border-right-width border-style border-color 4161border-right-color设置右边框的颜色border-color4162border-right-style设置右边框的样式border-style4162border-right-width设置右边框的宽度。 thin medium thick length 4141border-style设置四个边框的样式,可以设置一到四个样式。 none hidden dotted dashed solid double groove ridge i
6、nset outset 4161border-top简写属性。将所有用于上边框的属性设置于一个声明中。 border-top-width border-style border-color 4161border-top-color设置上边框的颜色。border-color4162border-top-style设置上边框的样式。border-style4162border-top-width设置上边框的宽度。 thin medium thick length 4141border-width简写属性。在一个声明中设置四个边框的宽度,可以设置一到四个值。 thin medium thick le
7、ngth 4141CSS 文本属性属性描述值IEFNW3Ccolor设置文本颜色。color3141direction设置文本方向。 ltr rtl 6162letter-spacing设置字符间距。 normal length 4161text-align对齐元素中的文本。 left right center justify 4141text-decoration向文本添加修饰。 none underline overline line-through blink 4141text-indent缩进元素中文本的首行。 length % 4141text-shadow none color l
8、ength text-transform控制元素中的字母。 none capitalize uppercase lowercase 4141unicode-bidi设置文本方向。 normal embed bidi-override 52white-space设设置元素中空白的处理方式。 normal pre nowrap 5141word-spacing设置字间距。 normal length 6161CSS 字体属性 (font)属性描述值IEFNW3Cfont 简写属性。作用是将所有针对字体的属性设置在一个声明中。 font-style font-variant font-weight
9、font-size/line-height font-family caption icon menu message-box small-caption status-bar 4141font-family 字体类型名称或者针对某元素的类属族名名称的优先列表。 family-name generic-family 3141font-size 设置字体的尺寸。 xx-small x-small small medium large x-large xx-large smaller larger length % 3141font-size-adjust 为元素规定 aspect 值。none
10、number -2font-stretch 收缩或拉伸当前的字体族。 normal wider narrower ultra-condensed extra-condensed condensed semi-condensed semi-expanded expanded extra-expanded ultra-expanded -2font-style 设置字体样式。 normal italic oblique 4141font-variant 以小型小写字体或者正常字体显示文本 normal small-caps 4161font-weight 设置字体的粗细。 normal bold
11、bolder lighter 100 200 300 400 500 600 700 800 900 4141CSS 外边距属性 (margin)属性描述值IEFNW3Cmargin 简写属性。在一个声明中设置外边距属性。 margin-top margin-right margin-bottom margin-left 4141margin-bottom设置元素的下外边距。 auto length % 4141margin-left设置元素的左外边距。 auto length % 3141margin-right设置元素的右外边距。 auto length % 3141margin-top 设置元素的上外边距。 auto length % 3141CSS 内边距属性 (padding)属性描述值IEFNW3Cpadding简写属性。作用是在一个声明中设置元素的内边距属性。 padding-top padding-right padding-bottom padding-left 4141padding-bottom设置元素的下内边距。 length % 4141padding-left设置元
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1