<div class="col-sm-2" style="text-align: right;" >
mytext1
</div>
<div class="col-sm-2" style="text-align: right;" >
mytext2
</div>
<div class="col-sm-2" style="text-align: right;" >
mytext3
</div>
I need to reduce the size of only second div
and I don’t want to use col-sm-1
since it’s too small and don’t want col-sm-2
since it’s too big. But I need something inbetween something like col-sm-1.5
is there a way to resolve this.
2
Answers
You can define your Custom class since bootstrap sm-1 and sm-2 corresponds to 8.33% and 16.66% you can create a custom class like so:
You could create a custom class that calculates the width based off the 12 columns in the grid.
Here I am dividing
100%
by 12 to get the width of one column, and multiplying it by 1.5.I have also added
padding: 0 15px
to the custom class to match Bootstraps default15px
left and right padding for their.col
classes.