Home >Web Front-end >CSS Tutorial >Abbreviation of font in css
This article will introduce the abbreviation of font in CSS in detail. Interested friends can refer to it.
The example code is as follows:
<!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>
Summary:
1. When abbreviated, font- Size and line-height can only be composed of one value through slash/ and cannot be written separately.
2. The order cannot be changed. This shorthand method only works when the font-size and font-family attributes are specified at the same time. Moreover, if you do not set font-weight, font-style, and font-variant, they will use the default values
Related recommendations:
How js matches and calculates font-size
How the font-size-adjust attribute optimizes web page layout
font-weight: how to deal with blod beating
css3 font variant font-variation detailed explanation
The above is the detailed content of Abbreviation of font in css. For more information, please follow other related articles on the PHP Chinese website!