srini
srini

Reputation: 13

How can i merge many css classes atributes into a single class

I'm having the same attribute for different 4 classess. So i want to reduce the code weight. So how can i make it as a single common class.

    .iass-general-config-wrapper h2
           {
               padding-bottom: 1px!important;
            }
    .iass-workload-config-wrapper h2
           {
               padding-bottom: 1px!important;
            }
     .iass-network-config-wrapper h2
            {
                padding-bottom: 1px!important;
              }
      .vdi-review-wrapper
            {
                 padding-bottom: 1px!important;
             } 

Upvotes: 0

Views: 38

Answers (2)

user4431269
user4431269

Reputation:

Take a look at, this will bring you far far away

http://www.w3schools.com/cssref/css_selectors.asp

h4, h5, h6 {
   color: pink;
}

Upvotes: 0

Dale
Dale

Reputation: 10469

You can "merge" them together as a multiple selector rule

.iass-general-config-wrapper h2,
.iass-workload-config-wrapper h2,
.iass-network-config-wrapper h2,
.vdi-review-wrapper
{
    padding-bottom: 1px!important;
}

Or as noted in the comments you could simply create a new class and apply that, resulting in much less code

.padding-bottom
{
     padding-bottom: 1px !important;
}

Upvotes: 3

Related Questions