I’m trying to remove classes like class="row" and class="col-md-12" coming from a script file from bootstrap. Can I override and remove it with css?
I’m trying to remove classes like class="row" and class="col-md-12" coming from a script file from bootstrap. Can I override and remove it with css?
3
Answers
I don’t believe you can remove a class from the markup with css. You could add an additional class and then make your needed style changes with that more specific selector.
I think that what you want is to hide them by default? If so, create a rule on your css for the mentioned classes.
Then after, if you want to show them, you can use js to present the elements with that class. Ex:
You can’t remove the class names via CSS, but you can retrieve all the elements with those class names and remove the class:
document.querySelectorAll(".row").forEach(r => r.classList.remove("row"));