Web Analytics Made Easy -
StatCounter Can it be set up for layout and CSS to change automatically? - CodingForum


No announcement yet.

Can it be set up for layout and CSS to change automatically?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Can it be set up for layout and CSS to change automatically?

    I'm working on a new layout for a website that will utilize CSS and HTML.
    My layout actually consists of four individual layouts that will represent Spring, Summer, Fall, and Winter. I'm trying to figure out however, if I will have to change the layout manually or if there is some way to set it up so that it will automatically change on a preset date.

    For example: The date is March 19th, the layout displays the "Winter" layout for visitors. A visitor returns to the site the next day only this time the site displays the "Spring" layout because it's set to change on the 20th of March.

  • #2
    A server side script that determines (by date) which CSS file to serve would be the way to do this.

    This page serves a different background image by time-of-day for example. Use a similar approach to change the css file by date would be easy enough to arrange.
    Last edited by jlhaslip; Apr 1, 2009, 04:19 AM.


    • #3
      Okay, well... that answers that it can be done...

      I have absolutely no experience with server side scripts what-so-ever sadly.

      Is there perhaps another way to achieve this? Or is using some kind of SSS the only way to achieve this effect?
      Last edited by Chelle the Cat; Apr 1, 2009, 03:15 PM.


      • #4

        This is a javascript solution, but again it is using different time periods of the day (however it uses the user's timezone). Would need tweaking to work with the seasons.


        • #5
          A server side solution would be best. You can ask in the PHP forum for a bit of help if you get stuck. Give it a try.
          Blog | Twitter
          Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
          CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
          Remember: no link, no code, no help!


          • #6
            Thanks, but due to the nature of the project and time line for it I really don't have time to learn a whole new coding language just to get this done (and I know absolutely nothing about working in PhP at this point in time). If it comes down to that being the only reliable way, I will have to hire out for the work to be done unfortunately.