css笔记

很久没写过前段的代码了,忘记了很多,由于公司项目要我写前端页面,所以今晚抽点时间看了下重要的一些css样式。

做了点小笔记


文本
text-decoration : none; 下划线|上划线|删除线|none
text-align : center; 文字对齐
line-height : 50px; 行高,可以设置文字垂直居中
word-break : break-all; 碰到div右侧折行
letter-spacing : 20px; 字间距
word-spacing : 20px; 词间距

光标属性:
cursor : pointer | wait | help

边框属性:
border-style : none | dotted | dashed | solid | double | inset | outset;
border-width : 20px;
border-color : #ccc;
border : 1px solid #ccc;

列表样式:
list-style-type : none | circle | square | decimal | lower-roman | upper-roman

尺寸属性:
width : 30px;
hieght : 20px;

min-width max-width

textarea属性
resize : none; 文本框不能拖动

表格属性:
border-collapse : collapse; 表格边框是否合并
border-spacing : 10px; 表格边框之间的距离

边距样式:
margin 外边距
padding 内边距(在标准浏览器里面会改变标签的宽度和高度,所以用的时候一定要小心)

定位:
相对定位
position : relative;
top : 10px;
left : 10px;
绝对定位
position : absolute;
top : 10px;
left : 10px;
z坐标轴
z-index : 5;

漂浮:
float : left;
float : right;

原文地址:https://www.cnblogs.com/it-cen/p/4215797.html