Selector Grouping

DataMine
by DataMine · 4 posts
10 years ago in HTML & CSS
Posted 10 years ago · Author
This is a short tutorial on Selector Grouping. Selector Grouping is the process in which you assigned multiple Selectors to a Declaration block. Selector Grouping is very useful for cleaning up your code, making it easier to work with and making it easier for other people to read/understand.

Selector Grouping allows you to use the same block of css code on multiple selectors saving you from having to re write that block of css code over an over again. So if you find that multiple parts of your web page share the same code, Selector Grouping is something to look into.

To group multiple selectors together, separate them with commas before the declaration block.

Below is an example of Selector Grouping:
Code
h1, h2, h3 { color: green; }


The above code does the exact same thing as this:
Code
h1 { color: green }
h2 { color: green }
h3 { color: green }


As you can see, the code with Selector Grouping applied is much smaller and simpler to read and work with. Selector Grouping is just one of the many practices a good coder will learn.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts