All,
Is there any way to define a custom CSS class that uses existing bootstrap classes?
For example, consider the following HTML snippet:
<div class="text-primary center-block">Here is some text</div>
Bootstrap will automatically make it blue and centered and displayed block. But adding all of those classes is a lot to remember. Can I just use my own class:
<div class="my_class">Here is some text</div>
And somehow in a CSS file add those Bootstrap properties?
The only solution I can think of is using JQuery like this:
$(document).ready(
function() {
$(".my_class").each(function() {
$(this).addClass("text-primary center-block");
});
}
);
But is there a better solution?
$(".my_class").addClass("text-primary center-block")