Override Inline CSS – I had no idea!

Just came across this link via dZone.


<div style="background: red;">
    The inline styles for this div should make it red.

We can fight that with this:

div[style] {
   background: yellow !important;

It doesn’t work in IE6, if you care.  But the places where I’ve needed this trick, I don’t care.

Like this Article? Subscribe to get every article sent to your email.

Related Post

  • Experiments with CSSExperiments with CSS Every once in a while, I like to use StumbleUpon to see what's out there.  Tonight, I found this site.  This is probably the best CSS site I've seen yet.  Not just a bunch of how-to […]
  • Secret to Unique FavIcon.ico files in DotNetNukeSecret to Unique FavIcon.ico files in DotNetNuke Well, it was a secret to me until yesterday anyhow.If you are running a DotNetNuke installation with multiple portals, you may have noticed that even if you replace the FavIcon.ico […]
  • Finding a CSS Class DefinitionFinding a CSS Class Definition A couple of weeks ago I pointed out that you could easily find the definition of a property, method, variable, or class by right-clicking the item and selecting, "Go To Definition" from […]
  • ASP.NET Debugger Timeout . . . Solution FoundASP.NET Debugger Timeout . . . Solution Found ... and such a simple solution!I've been fighting this one for quite a while.  Glad someone figured out a way around it.Vault of Thoughts - .NET Blog - ASP.NET Debugger Timeout In […]
  • Just an Observation…Just an Observation… I've been lurking in both the Microsoft and PHP Newsgroups for the last week or so and while I know the Microsoft groups have "people" in them too, what I've noticed is that when the […]

About Dave Bush

Dave Bush is a .NET programmer and Certified ScrumMaster who is passionate about managing risk as it relates to developing software. When he is not writing or speaking about topics related to Application Lifecycle Risk Management (ALRM), he is an example to his peers as he develops web sites in the ASP.NET environment using industry best practices.

One Pingback/Trackback