css div里引用em字体会变斜体_css常用样式font设置字体的多种变换(实例详解)

CSS 字体属性定义文本的字体系列、大小、加粗、风格(如斜体)和变形(如小型大写字母)font-family控制字体,由于各个电脑系统安装的字体不尽相同,但是基本装有黑体、宋体与微软雅黑这三款字体,通常这样写font-family:"黑体", "宋体","Microsoft YaHei"

font-size控制字体大小,我们设置字体大小是设置它的宽度,它的高度一般电脑系统默认字体大小是16px,所以字体大小尽量不要低于16px,1em=16px; font-weight: bold;/*控制字重 一般是100-900 常用lighter(细体) normal(正常)bold加粗 */至于这个font-style,一般默认是normal,也就是正常的,如果说你设置 font-style: italic;斜体话,其实和这个的效果是差不多的;文字间的间距用的line-height如果和高度相等话,就是垂直居中了。

通常font字体的简写:font:style weight size/line-heigt font-family /*要求必须出现的2个是 size与font-family*/

css常用样式font字体的多种变换

div{

font-family: 'Microsoft YaHei';/*微软雅黑*/

/* font-family: 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; */

/*字体加上双引号或者单引号,当有多个字体的时候,中间逗号分开*/

color:#f90;

font-size: 24px;/*控制字体大小*/

font-weight: bold;/*控制字重 常用lighter(细体) normal(正常)bold加粗 */

font-style: italic;/*等同于em*/

line-height: 30px;

}

/*font字体的简写:font:style weight size/line-heigt font-family*/

/*要求必须出现的2个是 size font-family*/

p{

font: 24px/1.5em 'Lucida Sans','Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;

letter-spacing: 1px;/*英文字母间距*/

word-spacing: 10px;/*英文单词间距*/

}

P::first-letter{

text-transform: capitalize;

}/*第一个字母::first-letter*/

p::first-line{

color:red;

}/*第一行::first-line*/

技术为王世界,欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界,

欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好技术为王世界,

欲问青天山顶景色是否独好技术为王世界,欲问青天山顶景色是否独好

Technology is king world, I want to ask if the scenery on the top of Qingtian Mountain is the king of technology,

I want to ask whether the scenery of Qingtian Peak is the king of technology. If the technology is the king of the world,

I would like to ask whether the scenery on the top of Qingtian Mountain is the king of the world. Is the scenery good?

总结

以上所述是小编给大家介绍的css常用样式font设置字体的多种变换,希望对大家有所帮助,也非常感谢大家对脚本之家网站的支持!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值