Results 1 to 3 of 3

Thread: Style Sheet Question

  1. #1
    Join Date
    Aug 2007
    Location
    Barcelona
    Posts
    28
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question Style Sheet Question

    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.

    S

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2007
    Location
    Essex, UK
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •