According to the time, the CSS files used during the day are loaded during the day, and the CSS files used at night are loaded at night.
How to achieve it?
If it is the server side
judge the time, then
" rel="stylesheet" type="text/css" />
That’s it
If you use js
you can
window.onload=function(){
var d = new Date().getHours();
if(d>8 && d < 18){
document.getElementById("css").setAttribute("href","day.css")
}else{
document. getElementById("css").setAttribute("href","night.css")
}
}
or
var c = "night.css"
if( d>8 && d < 18){
c="day.css"
}
document.write('')
It is best to judge on the server side.
If it is PHP, you can use apache rewrite url to rewrite a style.php file into style.css
and then the output format can be like this style.css?date=1380644282