Shorthand Properties allow the values of several properties to be specified within a single property. Shorthand properties are easier to write and maintain. They also make CSS file smaller and faster to load.
For example, the h2 element can be styled with font-style, font variant, font-weight, font-size, line-height, and font-family or with a single font property. see below:
Traditional:
font-variant: small-caps;
font-weight: bold;
font-size: 100%;
line-height: 120%;
font-family: arial, helvetica, sans-serif;
}
Shorthand:
}
Most shorthand properties do not require the values to be placed in a set order. However, when using the font property, it is safer to set values in the order specified by the W3C, which is font-style, font-variant, font-weight, font-size, line-height, and font family.
When font-size and line-height are used within the font property, they must be specified with font-size first, followed by a forward slash(/), followed by line-height.
Values for the short hand font property include font-style, font-variant, font-weight, font-size, line-height, and font-family. However, all of these values do not need to be included in a shorthand declaration. Foe example, for the <p> element, you might want to only specify values for font-size and font-family
}
In this case , font-style, font-variant, font-weight, and line-height are not included in the shorthand property, so they will be assigned their default values.
Helpful Articles
Steve Present Weight Loss: The 2 Secrets Of Weight Loss Success
2 Unusual Facts About Rapid And Lasting Weight Loss Success: In order to achieve lasting results, you MUST change your inner weight controller: Your subconscious mind...
Diabetic Renal Diet for CKD Patients Diet
Diabetic Renal Diet Guidelines Made Easy! Being that one of the most common extrarenal diseases affecting the kidney is diabetes mellitus, diabetic renal diet has become a topic of interest nowadays...
The Lemonade Diet
There are many people who have the primary goal of weight loss and they turn to the lemonade diet to lose weight quickly...
Tags: CSS, font, font-variant, font-weight, How To, line-height, shorthand