Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSS override in-line background style?

Posted on 2008-10-08
2
Medium Priority
?
851 Views
Last Modified: 2012-05-05
I am maintaining a web site, but it's built using pre-defined templates and I want to change the background image in the "contentheader" div container. The html looks like this:

<div id="contentheader" style="background-image:url('/global/images/background/image.jpg')">
  <div>some content</div>
  <div>some more content</div>
</div>

I can edit the CSS page that is used for this page, but I think the in-lins style tag would over-ride anything I added in the CSS file.

Is there a way to add a style attribute in a CSS page and then force it to ignore in-line attributes?

I would do this in Javascript but I need it to apply to all apges on the site and I don't want to edit them all manually.

Thanks. I know someone has an answer... :)
0
Comment
Question by:jopie916
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
DerkArts earned 2000 total points
ID: 22674010
in your ccs file:

#contentheader{
  background-image:url(/your/image.jpg') !important;
}

that overwrites the inline...
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question