Home » none » Override Inline CSS – I had no idea!

Override Inline CSS – I had no idea!

Just came across this link via dZone.

http://css-tricks.com/override-inline-styles-with-css/

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

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.

Related Post

  • 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 […]
  • iText IN ACTION – Creating and Manipulating PDFiText IN ACTION – Creating and Manipulating PDF While this isn’t specifically targeted at iTextSharp, which we’ve been covering in recent posts, this is really the closest book you are going to find on the subject. The basics are […]
  • Tab Control ActiveTabIndex Lost on PostbackTab Control ActiveTabIndex Lost on Postback I just got off the phone with a client who is using the MS-AJAX TabControl in one of his applications and any time he causes a postback, the tab resets to the first tab. If you've never […]
  • DotNetNuke CSS in your Module SettingsDotNetNuke CSS in your Module Settings I have a friend that is working at a local college who called recently because he was having some trouble with his CSS using the Module Settings feature where you can add additional code […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer focusing on ASP.NET, C#, Node.js, JavaScript, HTML, CSS, BootStrap, and Angular.JS.Does your team need additional help in any of the above? Contact Dave today.

One Pingback/Trackback