![]() |
What Is Grouping In CSS3?
Hello Friends,
What Is Grouping In CSS3? |
Grouping in CSS is a technique used to reduce code redundancy and write clean, concise easy to follow code. There are going to be many instances in which multiple CSS selectors will have the same declarations. In these cases, you can group all the selectors together and write the declarations only one time. For example, if you want to apply the exact same font size and color to three different headings you can write it as shown below.
h1{ font-size: 10px; color: green; } h2{ font-size: 10px; color: green; } h3{ font-size: 10px; color: green; } |
Instead you can shorten the code by grouping it like example below.
h1, h2, h3 { font-size: 10px; color: green; } |
All times are GMT -7. The time now is 03:01 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.