CSS杂记
文章目录
1.字体
1.1 字体
font-family: 微软雅黑;font-family: 'Microsoft Yahei';
1.2 粗体
font-weight: normal|bold|bolder|lighter;
也可以用数字: 100-700
1.3 斜体
font-style: italic|normal; 斜体
1.4 符合字体
font: italic 700 16px 'Microsoft Yahei';
顺序不能变:
- font-style
- font-weight
- font-size
- font-family
可以只有3和4,但此时两者都得有:font: 16px 'Microsoft Yahei';
- font-family
2. 文本
2.1 文本水平对齐
text-align: center|left|right;
2.2 装饰文本(上中下加条线)
text-decoration: none|underline|overline|line-through;
a: {text-decoration: none;} // a标签都不显示下划线
p: {text-decoration: underline;} // p标签都加下划线
overline=上划线
line-through=删除线
2.3 首行缩进
text-indent: 20px; // 每个段落的首行缩进
p: { text-indent: 20px; }
p: { text-indent: 2em; } // 2个文字

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论