ASP, PHP and JavaScript automatically switch the code of the CSS skins based on the time of day. Exchange of experience

Source: Internet
Author: User
According to the time automatically adjust the site style is a good idea, this time automatically adjust the site style is not anything new, remember a long ago have seen similar articles or methods, but there was no special attention. The following is the implementation of their methods, there are two ways to implement online:
First, the use of service-side code
ASP version:
elseif hour(now)<17 then
response.write "day.css"
else
response.write "night.css"
end if
%>
"/>
PHP版本:


二、采用JavaScript代码
  • rel="stylesheet" type="text/css" href="">elseif hour(now)<17 then
    response.write "day.css"
    else
    response.write "night.css"
    end if
    %>
    "/>
    PHP版本:


    二、采用JavaScript代码
  • >
    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.