js function can be placed in a separate js file or within the
tag of the current page
function getCSS()
{
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour<12)
display = "1.css";
else if (thehour>12)
else 🎜> display = "2.css";
'link rel="stylesheet" href=' display ' /';
css ='>';
document.write(css);
}
HTML file to which this style sheet is applied
Copy code
The code is as follows:
Display different prompt information at different times
js controls different time periods to display different css styles
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