Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

color: none effect in CSS to prevent override

Tags:

css

Update (problem): Once application is pushed to dev server, asp includes inject styles that override the actual custom coded needed styles. One instance below, wrapper div with a tag overrides all styled <a> tags and links within. It would be really quick to use none !important on the CSS color module. As disabling that everything resolves correctly. Now, I can do this with jQuery or (can move all a tag classes to the <head> with !important and override. Just wondering any thoughts or hacks about using or getting a 'none' effect in this type of scenario, that is all.


Let's just say situation / environment out of your hands.

And you must override a style.

Say your trying to override a color assigned to a div. Is the below valid / will it work? Is there an alternative. Defining a color not a possibility as will override other <a> tag colors.

#HUGEwrapperdiv a { 
   color: none !important;
}
like image 999
fred randall Avatar asked Jul 13 '15 18:07

fred randall


1 Answers

No, it won't work. It will be ignored because none is an invalid value for the color property.

Depending on what you're trying to achieve, you could set it to transparent/inherit/initial.

These values are somewhat self-explanatory. The value inherit will cause the element to inherit the computed value of the color property from its parent element. The value initial will set the color to the browser's default color (likely specified in the user agent stylesheet). It's worth pointing out that the initial value isn't fully supported in all browsers.

like image 167
Josh Crozier Avatar answered Oct 13 '22 21:10

Josh Crozier