您好,登錄后才能下訂單哦!
這篇文章主要介紹“html+css魔幻霓虹燈文字特效怎么實(shí)現(xiàn)”的相關(guān)知識,小編通過實(shí)際案例向大家展示操作過程,操作方法簡單快捷,實(shí)用性強(qiáng),希望這篇“html+css魔幻霓虹燈文字特效怎么實(shí)現(xiàn)”文章能幫助大家解決問題。
<h4>Aurora Borealis night</h4>
body{ background-color: rgb(4, 15, 36); }
h4{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 100%; text-align: center; font-size: 3em; text-transform: uppercase; letter-spacing: 10px; color: rgb(4, 15, 36); -webkit-box-reflect: below 1px linear-gradient(transparent ,rgb(218, 218, 218)); animation: san 6s linear infinite; }
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%); 居中對齊。先left與top 50%,再偏移自身長度與寬度50%達(dá)到居中。
text-align: center; 文字居中。
text-transform: uppercase; 字母變?yōu)榇髮憽?br/>letter-spacing: 10px; 每個(gè)字符間距離。
-webkit-box-reflect: 倒影效果。
animation: san 6s linear infinite; 定義動畫。
@keyframes san{ 0%,15%,50%,52%,70%,90%,99.1%{ color: rgb(4, 15, 36); filter: blur(2px); } 12%,15.1%,60%,70.1%,90.5%,100%{ color: rgb(255, 255, 255); text-shadow: 0 0 5px rgb(22, 138, 216), 0 0 25px rgb(22, 138, 216), 0 0 35px rgb(22, 138, 216), 0 0 105px rgb(22, 138, 216), 0 0 155px rgb(22, 138, 216); filter: blur(0px); } }
filter: blur(2px); 模糊
text-shadow: 0 0 5px rgb(22, 138, 216),
0 0 25px rgb(22, 138, 216),
0 0 35px rgb(22, 138, 216),
0 0 105px rgb(22, 138, 216),
0 0 155px rgb(22, 138, 216);
文字陰影。寫多行是為了陰影疊加,效果更亮。
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ background-color: rgb(4, 15, 36); } h4{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 100%; text-align: center; font-size: 3em; text-transform: uppercase; letter-spacing: 10px; color: rgb(4, 15, 36); -webkit-box-reflect: below 1px linear-gradient(transparent ,rgb(218, 218, 218)); animation: san 6s linear infinite; } @keyframes san{ 0%,15%,50%,52%,70%,90%,99.1%{ color: rgb(4, 15, 36); filter: blur(2px); } 12%,15.1%,60%,70.1%,90.5%,100%{ color: rgb(255, 255, 255); text-shadow: 0 0 5px rgb(22, 138, 216), 0 0 25px rgb(22, 138, 216), 0 0 35px rgb(22, 138, 216), 0 0 105px rgb(22, 138, 216), 0 0 155px rgb(22, 138, 216); filter: blur(0px); } } </style> </head> <body> <h4>Aurora Borealis night</h4> </body> </html>
關(guān)于“html+css魔幻霓虹燈文字特效怎么實(shí)現(xiàn)”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點(diǎn)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。