likes
comments
collection
share

CSS杂记

作者站长头像
站长
· 阅读数 301

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';顺序不能变:

    1. font-style
    1. font-weight
    1. font-size
    1. font-family可以只有3和4,但此时两者都得有:font: 16px 'Microsoft Yahei';

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个文字