css3 - How to override css attribute-only style -


i have page need modify behavior. element i'm working on has [attribute] directive, this:

<div class="someclass" myattributedirective></div> 

the myattributedirective has it's own css page defines styling, this:

[myattributedirective] { /* few different properties */ border: 1px solid red; position: relative; }  /* more class stylings related directive */ 

so see, in css, it's defining styles attribute, if attribute exists in element, apply stylings.

when view element in dev tools, doesn't quite right. in order "fix" it, un-check 1 of css properties causing issue, position: relative;.

but

i can't change "core" css directive, because it's used throughout application. and, if try override property, doesn't work (actually, cycling through different position: * options leads making things worse).

so, how override specific property, without changing core css file?

if want override style in case irrespective of order style applied, consider applying style inline in div.

<div class="someclass" myattributedirective style="position:absolute;"></div> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -