Jump to content

Header image


Fiesta

Recommended Posts

Hi, do hope that someone can help. Is it possible to change the header image in my css file, for different pages in my web site.Currently my css file looks like this/***** Header *****/#header {color:#ffcc33;background:#f0f8ff url(img/front.jpg) bottom left no-repeat;height:275px;margin:0 0 10px 0;padding:0;}#header h1 {font:Arial rounded MT Bold,Verdana,Tahoma,Arial,sans-serif;font-size:3em;font-weight:bold;letter-spacing:-2px;margin:0 0 4px 15px;padding:15px 0 0 0;}#header p {font-size:1.2em;letter-spacing:-1px;margin:0 0 20px 15px;padding:0 0 0 3px;}I realise that this can probably be done in the actual html pages, but it does not work for me! I cannot get the h1 to sit neatly over the image.I am working around this problem by creating 5 different css files, all identical except for the header image link, but it seems a messy way of doing things.assistance would be very gratefully received. thanks.

Link to comment
Share on other sites

CSS files are not 'dynamic', meaning they really can not be used to select the image for the page. Have you tried using the same image and css for all pages, but adding a new background image for selected pages and adding the style into the head of those pages? Add this line between the style tags in the html file (changing the image name):

#header {background:#f0f8ff url(img/NEW_front.jpg) bottom left no-repeat;}

According to the 'cascade', the elements and attributes styling in the head of the page should be the one chosen for display in that case. The other attributes should remain unchanged for the elements that are not altered in the page head..

Link to comment
Share on other sites

thanks jlhaslip, I now understand. I have added the 5 different images as you suggested by inserting them as backgrounds in the html files, so now I am back to one neat css file, your assistance much appreciated.my next task is to get a decent enquiry form up and running, so you never know, I will probably be back asking for more help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...