08-10-2017, 03:57 AM | #1 |
Registered User
Join Date: Aug 2016
Posts: 19
|
What Is Grouping In CSS3?
Hello Friends,
What Is Grouping In CSS3? |
08-10-2017, 09:44 PM | #2 |
Registered User
Join Date: Aug 2017
Posts: 93
|
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; }
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
08-10-2017, 10:13 PM | #3 |
Registered User
Join Date: Aug 2015
Posts: 18
|
Instead you can shorten the code by grouping it like example below.
h1, h2, h3 { font-size: 10px; color: green; }
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How increase the size of the element on mouse hover without using juery with CSS3? | arronmattwills | Graphic Design | 0 | 02-02-2014 09:52 PM |
HTML Button with CSS3: Tiny & Helpful Demo plus Tutorial | JavaScriptBank | Javascript | 2 | 10-31-2013 08:10 PM |
HTML Button with CSS3: Tiny & Helpful Demo plus Tutorial | JavaScriptBank | Javascript | 0 | 05-27-2013 08:10 PM |
HTML5 and CSS3 frameworks? | cianfie | Programming General | 7 | 10-23-2012 07:47 AM |