Answer the question
In order to leave comments, you need to log in
Bootstrap is a bad practice to add custom classes/styles to framework elements. How then is it better in my case?
Hello! I heard that it is not desirable to add your own classes to Bootstrap elements - this is a bad practice. For example: <div class="col-md-3 sub-content"> ...</div>
It's better to do this:
<div class="main">
<div class="col-md-3">
<div class="sub-content">... </div>
</div>
</div>
.main .col-md-3 {
....
}
Answer the question
In order to leave comments, you need to log in
Good day. And the one who
I heard that it is not desirable to add your own classes to Bootstrap elements - this is a bad practicespoke gave his arguments or arguments?
It's actually bad practice (and debatable in some cases) to override existing bootstrap properties set on specified classes (simply because it changes native behavior and makes it unexpected). A block with already assigned bootstrap classes can be assigned its own classes in cases where these classes extend (and do not overlap (again, this is not always the rule)) a set of properties given to the element.
In general, bad / good is a very vague concept and applying any statement categorically is a mistake, there are different situations and you need to act in accordance with them. There is no single practice in layout, there are many approaches.
And the piling up of classes so that they do not fit in one line on a 1366px screen is this normal?
col-6 col-sm-12 col-md-6 col-lg-4 text-center my-class__part1-ho4y-4tob-bilo-levee-na5px
Use inheritance. Don't torture bootstrap+).
Author: I have never heard of this before.
Classes can be added, for more convenient manipulation through js. Well, or to create an additional cascade. But it is better not to use specific properties.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question