Avatar of westdh
westdhFlag for United States of America

asked on 

I would like to know how to change style sheets based on the four seasons..date

I would like to know how to change style sheets based on the four seasons..date
HTML

Avatar of undefined
Last Comment
westdh
ASKER CERTIFIED SOLUTION
Avatar of Cornelia Yoder
Cornelia Yoder
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Or, of course, you could do a similar thing with a php CASE structure.

<?php
switch($season)
   {
   case "summer" :
     echo '<link rel="stylesheet" type="text/css" href="summer.css" />';
      break;
   case "winter" :
     echo '<link rel="stylesheet" type="text/css" href="winter.css" />';
      break;
   case "fall" :
     echo '<link rel="stylesheet" type="text/css" href="fall.css" />';
      break;
   case "spring" :
     echo '<link rel="stylesheet" type="text/css" href="spring.css" />';
      break;
   default :
     echo '<link rel="stylesheet" type="text/css" href="summer.css" />';
      break;
   }
?>

Avatar of westdh
westdh
Flag of United States of America image

ASKER

why is this not working

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
    <script type="text/javascript">

    function getSeason() {
    alert("hello")
    month = Date.getMonth();

    season = '';
    switch(month) {
        case '12':
        case '1':
        case '2':
            season = 'winter';
        break;
        case '3':
        case '4':
        case '5':
            season = 'spring';
        break;
        case '6':
        case '7':
        case '8':
            season = 'summer';
        break;
        case '9':
        case '10':
        case '11':
            season = 'fall';
        break;
    }
    alert(season);
}

    </script>
</head>
  <body onload="getSeason()">

</body>
</html>
Avatar of westdh
westdh
Flag of United States of America image

ASKER

Thanks
HTML
HTML

HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo