Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   HTML / DHTML (http://siteownersforums.com/forumdisplay.php?f=7)
-   -   CSS Font Shorthand (http://siteownersforums.com/showthread.php?t=59728)

davikerkrish 09-06-2012 04:26 AM

CSS Font Shorthand
 
When using shorthand on the font property you need to specify each property in the following order

body { font: font-style font-variant font-weight font-size line-height font-family; }

You don’t need to include every property, but know that for any you don’t include that property will be reset to it’s default.

eswari 10-16-2012 10:45 PM

When styling fonts with CSS you may be doing this:

font-weight: bold;
font-style: italic;
font-variant: small-caps;
font-size: 1em;
line-height: 1.5em;
font-family: verdana,sans-serif
There's no need though as you can use this CSS shorthand property:

font: bold italic small-caps 1em/1.5em verdana,sans-serif

davikerkrish 10-22-2012 05:23 AM

You can separate by commas like "bold","italic"

abhirampathak3 12-04-2012 11:50 PM

CSS Font Shorthand and styling fonts with CSS you may be doing with
font: 1em/1.5em bold italic serif

instead of

font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-family: serif

Please try for it.

jaysh4922 12-05-2012 12:21 AM

When you use the shorthand property, i think you should remember that it requires both the size and the family...


All times are GMT -7. The time now is 07:11 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.