Results 1 to 5 of 5
  1. #1
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Naive CSS question

    Having seen that lots of stuff about the banner(s) and navigation at the top of the webpage, and navigation at the left of the webpage, is set up in CSS, once only, and then the CSS functions (excuse probably incorrect jargon!) are invoked in the webpage with all the fixed text and images being added there - in each individual webpage...

    ...I was wondering: why couldn't all the 'fixed' content, including the image links, text, address links etc, be put in CSS once only and be invoked in each webpage with a single call/invocation before all the variable content for that page is added?

    No doubt there is a very good reason, but it seems like a sensible idea to me - on the face of it.

    Thanks!
    BATcher

    Time prevents everything happening all at once...

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Naive CSS question

    There is no real way to do it with just cascading style sheets as their primary job is to provide layout. The HTML is the content, the CSS is the way to layout the content.

    However, you could Server Side Includes or Client Side Includes, the former is the better method but the server hosting the HTML has to have this functionality enabled.

    Have a look here for a good description:

    How do I include one HTML file in another?
    Jerry

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Naive CSS question

    There is a feature in CSS that lets you add content "before" or "after" an element. However, I doubt this extends to anything as fancy as a whole menu. If you're curious, you can explore from here: CSS2 - :before and :after @ ppk's quirksmode site.

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: Naive CSS question

    Thanks to you both - I'll check through the references to see if there's anything for me.

    I like the idea of being able to 'include' a block of HTML, but I can't see how you could easily do this and be able to test both the local and the server-hosted version of the website. Hmmm.
    BATcher

    Time prevents everything happening all at once...

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Naive CSS question

    If you have XP Pro, you can run IIS locally. I've used that for testing when I'm "offline" and can't test off the server.

Posting Permissions

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