What are the shorthand rules for CSS font properties
This article mainly introduces what the abbreviation rules of CSS font attributes are. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
Shorthand rules for CSS font properties
Generally, setting font properties with CSS is done like this:
Font-weight:bold; font-style:italic; font-varient:small-caps; font-size:1em; line-height:1.5em; font-family:verdana,sans-serif
But you can also write them all on one line:
Font:bolditalicsmall-caps1em/1.5emverdana,sans-serif
Just one caveat: this shorthand method works only if both the font-size and font-family properties are specified. Also, if you don't set font-weight,font-style and font-varient, they will use the default, which should be noted.
The above is all the content of the article "what are the abbreviation rules for CSS font attributes?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!