0

So what I'm trying to do is change the column class for bootstrap 3 within a div with an id.

Here is my adjustments to my columns in my css file.

.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,
.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, 
.col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, 
.col-sm-11, .col-sm-12, .col-sm, .col-sm-auto, .col-md-1, 
.col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, 
.col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,
.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, 
.col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, 
.col-lg-10, .col-lg-11, .col-lg-12, .col-lg,
.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, 
.col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, 
.col-xl-10, .col-xl-11, .col-xl-12, .col-xl,
.col-xl-auto 
{
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

I use these column classes within a div of an id called #card-block. What im trying to say is can i do something like this? Like add "#card-block >" to everyone of those classes?

    #card-block > .col-1 
    {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
    }

Thank you in advance.

Carlitos
  • 419
  • 4
  • 20
  • 1
    Wouldn't it be better to declare your selectors like so: `#card-block [class*="col"]`? This will apply to any element with a class that contains the term "col". – UncaughtTypeError Oct 13 '17 at 14:12

1 Answers1

2

I think you are trying to target every class that starts with "col-" which you can do with an attribute selector...and the caret modifier.

#card-block [class^="col-"] {
    */  your styles here /*
}
Paulie_D
  • 107,962
  • 13
  • 142
  • 161