The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Change body background color each week from four set colors

  • # May 20, 2013 at 8:48 am

    Where I work, they use colored tags that determine what week clothing items were received. They use only four colors (red, green, blue, yellow). We would like to create a page in which the background color changes to that week’s color. I am sure this is simple but I am still new to PHP and am trying to automate trivial things like this as best as possible.

    Thanks in advanced for your help.

    [Josh McClanahan]( “Josh McClanahan”)
    from [Digital Valdosta]( “Digital Valdosta”)

    # May 20, 2013 at 10:02 am

    this might not be the most elegant solution but its something

    $day = date(‘l’);

    if($day == ‘Monday’)
    //monday color code
    elseif($day == ‘Thuesday’)
    //thuesday color code
    //..and so on…

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed