css笔记

1、根据 CSS,子元素从父元素继承属性。
2、后代选择器(包含选择器):当前元素的所有子级
3、子元素选择器(当前元素下的子级): >
4、相邻兄弟选择器(+)
5、id区分大小写
6、类名不能以数字开头
7、属性选择器: [属性名=属性值]
8、background-image: url(/i/eg_bg_04.gif);
9、background-repeat: repeat-x 背景图片平铺效果;
10、 background-attachment:fixed 背景图片固定
11、text-indent 首行缩进
12、word-spacing 单词之间的间隔,默认为0
13、letter-spacing 字符间隔
14、text-transform: none|uppercase|lowercase|capitalize
--capitalize 每个单词首字母大写
15、text-decoration:none|underline|overline|line-through|blink
--underline 下划线
--overline 上划线
--line-through 贯穿
--blink 文本闪烁
16、direction:ltr|rtl 文本方向
--如果是行内元素,只有当unicode-bidi=embed|bidi-override才能生效
17、font-weight:normal|bold 文本粗细
18、设置链接样式
->a:link 普通未被访问的链接
->a:visited 用户已访问的链接
->a:hover 鼠标位于链接上方
->a:active 鼠标被点击时

19、
display:block;
font-size:14px;
120px;
background-color:blue;
font-decoration:none;
font-weight:bold;
color:white;
text-align:center;

20、list-style-type:square 列表样式
21、list-style-image:url() 用图像代替标识
22、list-style-position:inside|outside|inherit
->inside列表项目标记放置在文本内
->outside列表项目标记位于文本左侧
23、可以将list-style-type/image/position 简写为list-style
24、border-collapse:collapse; 将表格边框折叠为单一边框
25、text-align:设置表格中文本的水平对齐方式
26、vertical-align:设置表格中文本的垂直对齐方式
27、padding 文本内容与边框的距离
28、caption-side:top|bottom设置表格标题的位置
29、table-layout:fixed|automatic 设置表格布局方式
30、outline属性:所有的元素边框外面还有一层,叫做轮廓,起到突出元素的作用。
31、padding不允许使用负值
32、border-color:transparent 透明颜色的边框
33、overflow:auto|scroll
34、clip:rect() 设置元素的形状
35、position:absolute|fixed|relative|static
绝对定位的元素的位置相对于最近的已定位祖先元素,如果元素没有已定位的祖先元素,那么它的位置相对于最初的包含块。
36、opacity:0-1 透明度 

原文地址:https://www.cnblogs.com/lanleiming/p/5026757.html