View Full Version : CSS and rotating header

08-10-2007, 09:58 AM
Hi all

I have the following that specifies the header image:

.header {
background: url(img/header.jpg) no-repeat;
height: 180px;
margin: 0 auto;
width: 630px;

Is it possible to have this code specify a different header image for each html page?

Thanks in advance!

08-10-2007, 11:20 AM
I believe the <style> tag will override an external stylesheet, so in between your <head> and </head> place this and change it on every page:

<style type="text/css">
.header { background: url(img/header2.jpg); }

08-10-2007, 11:51 AM
thanks mate, worked like a charm:

.header {
background: url(img/headers/state_1.jpg);

Bill Posters
08-10-2007, 01:08 PM
I believe the <style> tag will override an external stylesheet,
Not necessarily.

Presuming you mean embedded CSS. (External CSS can be @imported via style elements)...

It depends in which order you add the external stylesheet and embedded styles to the document.
If you add the external stylesheet after the embedded styles, then the external stylesheet will win over the embedded rules whenever property conflicts occur.
If the embedded CSS comes after the external stylesheet in the markup, then the embedded CSS will win over whenever property conflicts occur.