Special welcome gift. Get 50% off your first courses with code “AS50”. Find out more!

HomeCoachingInterviewCSS Q/AHow are shorthand properties are used in css? Give examples.
react course 17

How are shorthand properties are used in css? Give examples.

One of the primary advantages of css is that it greatly reduces page load times. Writing multiple properties and their values in a single line of css code is known as css shorthand technique. One thing to be kept in mind is that while using the css shorthand technique is that the order of specifying the values of an attribute must be maintained. In case the user wants to keep a value as default it is not needed to be mentioned.

For Example:

margin-top: 5em;
margin-bottom: 3em;
margin-right: 1em;
margin-left: 1em;
margin: 5em 1em 3em (top, right and left, bottom);

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

Categories

ads sidebar 1

You May Also Like

It’s about making websites work wherever the web is. Different devices with different sizes and different capabilities. Responsive design is...
It’s an alternative to graceful degradation, which concentrates on the matter of the web. The functionality is same, but it...