Home >Web Front-end >CSS Tutorial >ASP, PHP and javascript automatically switch CSS skin code according to time period_Experience exchange
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