本篇文章将详细介绍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:'宋体'}
</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的缩写的详细内容。