One of the cool design elements of Shi Wai Yuan is the dynamically changing mood-setting background of the site. At this point the site has 6 different backgrounds (grapes, wood, leaves, sky, steel & carbon fibre), each supposed to be somewhat relevant to the section of the site being viewed; so you’ll find the background of the site is grapes when you’re viewing the wine and spirits section of the site, and greenery when you’re browsing the health section.
This is actually pretty easy to do - we’re just applying different classes to the <body> tag of the site, so that different background graphics can be loaded via CSS.
^ This loads leaves in the background.
^ This loads clouds in the background
^這將採用葉子作背景
^這獎採用雲彩作背景
其實這是很容易的 - 我們只是使用網站上不同類型的<body>標籤,讓不同背景的圖形可以通過加載的CSS得以实现。
^在背景加載葉子。
^在背景加載雲彩。