View Full Version : Style Sheet Question

12-08-2007, 07:09 PM
Hi. I have a stylesheet in which I want to add the website header and a photo that will then appear on every page of my site. I have tried using the background-image declaration but for me it doesn´t work. Apart from wanting the header (a .gif) and the photo on each page, I also want to make some text, a backbutton and the menu appear on each page. I am new to CSS and basically, just need to find out how to write/input these items just ONCE in the stylesheet instead of having to repeat the same thing on each page.

Many thanks for your help.


12-08-2007, 07:43 PM
You probably can do it with background-image, but you still have to add the correct markup to each page. CSS is designed for style, not markup. To automatically add some markup to your pages, you should use a server-side language of some sort, such as PHP. Stripped-down server-side extensions that don't provide as much flexibility and functionality may also be available, such as server-side includes (SSI) or Microsoft's FrontPage Extensions.

12-09-2007, 11:08 AM
It sounds as if you need some form of template that will apply to each page. Most web editors will allow you to create such templates.

However, if you have a lot of pages, then applying a template to pre-existing pages is not so straightforward. Web editors should offer the facility of a global search and replace. If you can get one page displaying what you want, then you can insert this markup and content into all your pages.

Ideally any such common markup can be placed in an include file. However, this assumes that your server supports this. All you have to include in each page then is the include markup.

It would help if you provided a link to the page you are trying to modify, and to your stylesheet.

John Rostron