首页  >  文章  >  web前端  >  css中font的缩写

css中font的缩写

墨辰丷
墨辰丷原创
2018-05-09 17:58:301781浏览

本篇文章将详细介绍css中font的缩写,有感兴趣的小伙伴参考一下。

实例代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<style> 
    .login_top{height:26px;font:bold 14px/26px "宋体"; border:1px solid #000} 
    .login_top2{height:26px; line-height:26px; font-weight:bold;font-size:14px;border:1px  
solid #000;  font-family:&#39;宋体&#39;} 
</style> 
<div class="login_top">我垂直不居中</div> 
<br/ > 
<div class="login_top2">我垂直居中</div>

总结:

1、简写时,font-size和line-height只能通过斜杠/组成一个值,不能分开写。

2、顺序不能改变.这种简写方法只有在同时指定font-size和font-family属性时才起作用。而且,如果你没有设定font-weight, font-style, 以及 font-varient ,他们会使用缺省值

相关推荐:

js如何匹配计算font-size

font-size-adjust属性如何优化网页排版

font-weight:blod跳动如何处理

css3字体变体font-variation详解


以上是css中font的缩写的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn