css-6.文本格式化

1.指定字体
font-family:value1,value2;

2.字体大小
font-size:value;

3.字体加粗
font-weight:normal、bold、value

4.字体样式
font-style:normal、italic

5.小型大写字母
fonnt-variant:normal、small-caps
eg:
font-family: "微软雅黑","宋体","Arial";
/*一般来说如果是中文就用中文字体,如果是数字和字母就用英文字体(Arial,Times)
* 微软雅黑 类似Arial
* 宋体类似Times
* */
font-size: 16px;
font-weight: bold;
font-style: italic;
font-variant: small-caps;
控制文本格式
·文本颜色color:value
·文本排列text-align:left、right、center
·文本修饰text-decoration:none、underline
#a1{
text-decoration: none;
color: orangered;
}
·行高line-height:value;如果是多行文字,间距增加,单行文字,设置line-height的值等于height,文字垂直居中
·首行文本缩进textinde:value;   text-indent: 2em;首行文本缩进可以用em做单位,多个段落必须放在独立的p便签,不然浏览器不会识别为段落
·文本阴影text-shadow:h-shadow v-shadow blur color;text-shadow: 1px 1px 0px red;

溢出
overflow: hidden;
/*文本溢出属性,必须建立在overflow:hidden*/
white-space: nowrap;
/*nowrap文字不换行,normal正常*/
text-overflow: clip;
/*clip 裁剪 。ellipsis 显示···*/
换行
word-break:break-all 长单词换行
word-break:keep-all 换行   长单词不换行
word-break:normal   系统默认

空格
letter-spacing: 2em;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值