The CSS code writing order of font and line-height is different, resulting in different display effects_Experience exchange

WBOY
Release: 2016-05-16 12:07:48
Original
1903 people have browsed it

I accidentally discovered that when applying both the font and line-height attributes in CSS to the same HTML tag, you have to be careful. The writing order of the two is different, which will lead to different display effects.
That is:
>>> If you write font first and then line-height, the display effect will be normal
>>> If you write line-height first and then font, the effect defined by line-height will be Lost, this BUG appears under IE, Firefox, and Opera

Please see the following code for the specific effect:

h1:


IECN.Net - Focus on Web technology and experience the fun of development!


IECN.Net - Focus on Web Technology, experience the fun of development!



div:


IECN.Net - Focus on Web technology and experience the fun of development!

IECN.Net - Focus on Web Technology, experience the fun of development!



Original text: http://www.cnlei.org/blog/article.asp?id=343

Note: After reading Fengyan’s message, go Check the CSS help document

Quote
The definition parameters of font must be arranged in the following order. Only one value is allowed per parameter. If ignored, the default value of the independent property corresponding to its parameter will be used:
font : font-style || font-variant || font-weight || font-size || line-height || font-family
Example: p { font: italic small-caps 600 12pts/18pts 宋体; }

Author: ztu http://www.dnew.cn/post/217.htm#topreply
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template