css - Why bootstrap use '!important' for responsive classes? -
bootstrap responsive utilities using '!important' doesn't make sense me. , does't inheritance col-xx-xx does. i'd know why added important these class. mentioned specificity purpose, mean? in addition, show , hide classes seems use important well. why?
while using !important
idea noticed yourself, since pain overwrite without using !importnat
yet again, believe tb has reason doing responsive utilities.
if state want ie. button not visible on ie. small displays, setting hidden-sm
class button, never want visible on small displays. if not use important on utility class, , ie. want block button on other display sizes adding .btn-block
class, button become visible again on small displays, since .btn-block
sets display
property block
. or @ least could, depending on order of things, since .hidden-sm
, .btn-block
have same specificity when comes cascading rules of css.
nothing can without !important
statement. 1 of edge cases have use guarantee correct behavior.
but right in questioning this, !important
should used last resort!
Comments
Post a Comment