Home >Web Front-end >CSS Tutorial >Caution: CSS code writing order is different, resulting in different display effects_Experience exchange

Caution: CSS code writing order is different, resulting in different display effects_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:10:101778browse

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, then line-height, the display effect will be normal
>>> If you write line-height first, then font, then line The effect defined by -height will be lost. This BUG appears under IE, Firefox, and Opera.

For specific effects, please see the following code:


[Ctrl+A select all Note: If you need to introduce external Js, you need to refresh to execute ]
Statement:
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