CSS是一種強(qiáng)大的樣式表語言,可以用來添加各種***到網(wǎng)頁中,下面是一些常見的CSS***代碼示例,你可以根據(jù)需要選擇適合你的***。
1、漸變背景:
body { background: linear-gradient(to right, red, orange, yellow, green, blue, purple); }
2、旋轉(zhuǎn)動畫:
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } div { animation: rotate 2s linear infinite; }
3、縮放動畫:
@keyframes scale { from { transform: scale(1); } to { transform: scale(2); } } div { animation: scale 2s linear infinite; }
4、透明度漸變:
body { opacity: 0; transition: opacity 2s linear; } body:hover { opacity: 1; }
5、彈性動畫:
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-10px); } } div { animation: bounce 2s linear infinite; }
這些***代碼只是CSS的冰山一角,還有很多其他的***等待你去探索,你可以根據(jù)自己的需求和喜好來選擇適合的***,并調(diào)整它們的參數(shù)和樣式來適應(yīng)你的網(wǎng)頁,希望這些示例能幫助你開始使用CSS來添加一些炫酷的***到網(wǎng)頁中!
版權(quán)聲明:除非特別標(biāo)注,否則均為本站原創(chuàng)文章,轉(zhuǎn)載時請以鏈接形式注明文章出處。