I want to be able to change all the 3's quickly into whatever number I need. (I have separate CSS I haven't included here, but please let me know if I need to add it.)
<div class="container">
<div class="col-md-12 hero imgProperties"></div>
<div class="col-md-3 rock imgProperties"></div>
<div class="col-md-3 pumpkin imgProperties"></div>
<div class="col-md-3 soup imgProperties"></div>
<div class="col-md-3 building imgProperties"></div>
<div class="col-md-3 island imgProperties"></div>
<div class="col-md-3 banana imgProperties"></div>
<div class="col-md-3 beetle imgProperties"></div>
<div class="col-md-3 chain imgProperties"></div>
<div class="col-md-3 twigs imgProperties"></div>
<div class="col-md-3 petals imgProperties"></div>
</div>
I've tried setting up a variable two different ways, locally and globally. (I suspect I should be making this local, not global, but please correct me if I'm wrong)
Locally -
--elementColumns: 3;
And globally -
:root {
--elementColumns: 6;
}
And in both cases, calling for it like this:
<div class="col-md-(var(--elementColumns)) rock imgProperties"></div>
But none of that is working. It just makes that one element not show up on the page.
How do I do this correctly? Is there a better way to change lots of Bootstrap column widths at once? (If I can do this via CSS alone, I would prefer it, but JS solutions would be appreciated too.)