CSS样式

背景色:background-color background-color:yellow;/background-color:#00ff00;/background-color:rgb(255,0,255);

背景图像:background-image background-image: url(/i/eg_bg_04.gif);

背景重复(背景图像进行平铺):background-repeat,,repeat-x 和 repeat-y分别水平或垂直方向上重复,no-repeat 则不允许重复,repeat 导致图像在水平垂直方向上都平铺 background-image: url(/i/eg_bg_03.gif);background-repeat: repeat-y;

背景定位:background-position,属性值:center、top、bottom、right、left;可以是百分比,以左上角为基准;长度px,也是以左上角为基础 background-position:top;/background-position:66% 33%;/background-position:50px 100px;

背景关联:文档比较长,那么当文档向下滚动时,背景图像也会随之滚动,background-attachment 属性防止这种滚动.默认值是 scroll,固定的(fixed) background-attachment:fixed

缩进文本: text-indent text-indent: 5em;

水平对齐:text-align ,值 left、right 和 center 会导致元素中的文本分别左对齐、右对齐和居中。

字间隔:word-spacing 改变字(单词)之间的标准间隔。其默认值 normal 与设置值为 0 是一样的。 word-spacing: 30px;

字母间隔:letter-spacing 字符或字母之间的间隔

字符转换:text-transform 值none、uppercase 、owercase、capitalize ;capitalize 只对每个单词的首字母大写

处理空白符:white-space 默认行为white-space: normal;丢掉多余的空白符。如果给定这个值,换行字符(回车)会转换为空格,一行中多个空格的序列也会转换为一个空格。 值 nowrap,防止元素中的文本换行,除非使用了一个 br 元素 pre-wrap,那么该元素中的文本会保留空白符序列,但是文本行会正常地换行。如果设置为这个值,源文本中的行分隔符以及生成的行分隔符也会保留。pre-line 与 pre-wrap 相反,会像正常文本中一样合并空白符序列,但保留换行符。

指定字体系列:font-family 字体系列:Serif、Sans-serif 、Monospace、Cursive、Fantasy font-family: sans-serif; font-family: Georgia, serif;不存在第一种时,使用第二种

字体风格:font-style 值 normal - 文本正常显示 italic - 文本斜体显示 oblique - 文本倾斜显示

字体加粗:font-weight 属性设置文本的粗细 值normal(400)、bold(700)、关键字 100 ~ 900 为字体指定了 9 级加粗度 font-weight:900;font-weight:bold;

字体大小:font-size 可以用em和px表示,16px=em

设置链接的样式 a:link - 普通的、未被访问的链接 a:visited - 用户已访问的链接 a:hover - 鼠标指针位于链接的上方 a:active - 链接被点击的时刻 a:hover 必须位于 a:link 和 a:visited 之后 a:active 必须位于 a:hover 之后 a:link {color:#FF0000;}   a:visited {color:#00FF00;}  a:hover {color:#FF00FF;}  a:active {color:#0000FF;} 

列表类型: list-style-type list-style-type : square;

列表项图像:list-style-image ul li {list-style-image : url(xxx.gif)}

列表标志位置:list-style-position

list-style合并:li {list-style : url(example.gif) square inside}

表格边框:border table, th, td{border: 1px solid blue; }

表格宽度和高度:width 和 height table{100%;}   th{ height:50px;}

表格文本对齐:vertical-align 属性设置垂直对齐方式,text-align 属性设置水平对齐方式

表格内边距:padding

表格颜色:设置边框的颜色,以及 th 元素的文本和背景颜色 table, td, th{ border:1px solid green;}   th{background-color:green;color:white;}

outline 在一个声明中设置所有的轮廓属性。

outline-color 设置轮廓的颜色。

outline-style 设置轮廓的样式。 

outline-width 设置轮廓的宽度 p {border:red solid thin;outline-style:dotted;outline-color:#00ff00;outline-3px;outline-style: outset;}

原文地址:https://www.cnblogs.com/hongfu/p/4323831.html