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
Release: 2016-05-16 12:04:36
Original
1921 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template