CSS Tuesday: Overide Inline Style

CSS Hints HOWTOs

How many times have you worked with either someone else’s code or some crazy dynamically generated code that uses inline styles for everything which you need to change or override but cannot for some reason or another? I have seen this a lot with custom applications written by programmers who think they are doing designers some sort of favor.

Something that I recently found that will allow you to override inline styles:

<p style="margin:20px">The inline style (style=) will give the paragraph a 20px margin.</p>

Let’s override that because I think 20px is overkill and I only have access to the stylesheet:

p[style] {margin:10px !important;}

Of course that will override any paragraph tag that has an inline style – but you can see where this is going.

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

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Web Development WordPress

WordPress Wednesdays: All Posts in a Parent Category

The need to show all posts in a particular category or that category’s sub categories is very high. There are not too many projects out there that do not require a customized search, a menu, or a listing of some sort where the user wants to include all posts (or exclude) that belong to a […]

Podcasts

Media Mondays: Q101's Phone Taps

I generally do not listen to the radio, but I really enjoy listening to Chicago’s Q101 in the mornings and afternoons just to hear the fun phone taps. What is this I speak of? Think Jerky Boys, but better. Basically- people set up their friends to get a call from a woman called Clarissa Jenkins […]