Home >Web Front-end >CSS Tutorial >ASP, PHP and javascript automatically switch CSS skin code according to time period_Experience exchange

ASP, PHP and javascript automatically switch CSS skin code according to time period_Experience exchange

WBOY
WBOYOriginal
2016-05-16 12:04:361916browse

It is a good idea to automatically adjust the site style according to time. This automatic adjustment of site style according to time is nothing new. I remember seeing similar articles or methods a long time ago, but I didn't pay special attention to it at the time. Let’s talk about their implementation methods. There are currently two implementation methods on the Internet:
1. Using server-side code
ASP version:
elseif hour(now) response.write "day.css"
else
response.write "night.css"
end if
%>
"/>
PHP version: STRONG>

if($ hour echo 'morning.css';
else if($hour echo 'day.css';
else
echo 'night.css'; ?>
" />
2. Using JavaScript code

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn