名称 | 权重 |
---|---|
* | 0 |
标签,伪元素 | 1 |
类,属性选择器,伪类 | 1 0 |
id选择器 | 100 |
内联 | 1000 |
!important | 正无穷 |
input,textarea{
outline:none;//去掉轮廓、外边框
outline-color: blue;
outline-stlye:dotted;//轮廓样式
outline-width: 16px;
}
浏览器对父子选择器的匹配规则,从右到左,从下往上
宽高、字体、颜色、边框
宽高的属性:width, height, min-width, min-height, max-width, max-height
容器盒子要隐藏溢出的部分 overflow: hidden;
浏览器默认的字体大小是16px,浏览器设置字体的时候是设置高度,宽度自动缩放
字体粗细
font-weight: lighter/normal/bold/bolder/100-900
字体样式,并不是所有字体都有斜体样式,oblique强制变成斜体
font-style: italic(斜体)/oblique(也是斜体);
设置字体 font-family可以写复合值,中文字体标识,有空格的字体标识要加双引号
通用字体:arial
font-family
字体颜色
color:
border边框
盒子的可视宽高等于宽高加上两边宽高
border: 1px solid #000;相当于
border-width: 1px;上下左右
border-width: 5px 10px;上下 左右
border-width: 5px 4px 10px;上 左右 下
border-width: 5px 4px 10px 12;上 右 下 左
border- style:solid/dotted/dashed/double/groove/ridge/inset/outset;
border-color: #000;
border-top: 1px solid #909;
border-right: 3px solid #009;
border-left: 5px solid #099;
border-bottom: 7px solid #900;
text-align对齐要在一个有宽高的容器内部
行高,一行占的高度
line-height
文本缩进 text-indent
text-indent: 2em;
text-decoration: underline(下划线,ins标签也是下划线)/line-through(删除线)/overline(上划线)/none(去掉线)
cursor设置光标
cursor: pointer/not-allowed(禁用)
单行文本截断和显示省略号的三大件
white-space: nowrap(不换行)
overflow: hidden;
text-overflow: elipsis(省略号)
visibility:hidden保留被隐藏的元素所占的HTML文档空间
display: none不保留隐藏的元素所占的HTML文档空间
opacity值越大透明度越低