Automatically switch the CSS style of your site based on the time period

Source: Internet
Author: User
Tags current time

Several sets of website switchesCSSStyle is nothing new. Everyone knows how to get it. An interesting site found in the morningHttp://www.leemunroe.com/
& OSX % d7FF0 is also a switching style. But he made some small adjustments. The site will automatically adjust the site style according to the current time. The author made three sets of skin for the site in the morning, afternoon, and night, mainly for the background. The system will use the morning skin before. After, the site will be automatically replaced with the afternoon style, and after, it will be replaced with the evening style.

The main function is to determine the code based on the header, which is easy to understand. If you are interested, try it on your own.

The CSS version code is as follows: The Flash bar new community Lx "fgvtcm

! UV l S; g6N; P' w) @ 0 <link rel = "stylesheet" type = "text/css"
; Ys "xm5T_4] # Hp0href =" <? Php $ hour = date ("H"); if ($ hour <12) echo "morning.css"; elseif ($ hour <17) echo "day.css "; else echo "maid";?> Flash Bar New Community 7 | yXz4DdSu
"/>

The ASP code is as follows:

<Link rel = "stylesheet" type = "text/css" href = "<%
! LCGn: Uy sg0if hour (now) <12 then flash bar new community $ yh0cA i8
Response. write "a.css"
([0 | {m] H5 @ 0 else
9} 3N] 7j-} # d0 if hour (now) <17 then
TPX! J (? H0 response. write "B .css" Flash bar new community DU: y1T C7L5v4D {3? _
Else flash, new community 6 w A4Im9S0q) m + w1? J
Response. write "c.css"
B/ZafC9Mp0 end if new community _ V: oMs V @ r * z
End if Flash bar new community H &] w * nQ ^ | + X 'V: ^ I
%> "/>
 
 
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.