user11417397
user11417397

Reputation:

How to make text flash and glow using css

I have this css but doesn't work to make my text glow and flash:

 @import
 url(//fonts.googleapis.com/cssfamily=Pacifico);
 body {
 min-height:100vh;
 padding-top:5rem;
 background:
 #112
 url(//images.weserv.nl/url=i.imgur.com/6QJjYMe.jpg)
 center no-repeat;
 background-size: cover;
 margin: 0;
 overflow:hidden;
 }

.lasvegas {
font-family: 'Pacifico', cursive;
font-size:80px;
border: none;
color: rgba(255,255,255,0.6);
text-align:
center;
text-shadow: 1px 5px 4px rgba(0,0,0,.3), 0 0 2px
rgba(255,255,255,1), 0 0 10px
rgba(255,255,255,1),  0 0 20px rgba(255,255,255,1), 0 0
30px rgba(255,255,255,1),  0 0 40px #ff00de,0 0 70px
#ff00de,  0 0 80px #ff00de, 0 0 100px #ff00de;
 }
 .lasvegas
 span {
animation: blink .3s infinite alternate;
}
.lasvegas
span.delay {
animation-duration:6s;
animation-delay: 2s
animation-direction: alternate
cubic-bezier(0.5, 0.2, 0.3,
1.0)
}

@keyframes blink {
0%  {
}

50% {
}

60% {
text-shadow:0 0
2px rgba(255, 255, 255, .1), 0 0 10px rgba(255, 255, 255, .
4); text-stroke: 2px rgba(255,255,255,0.05);
}

70% {
text-
shadow: 0 0 2px rgba(255,255,255,1), 0 0 10px.
rgba(255,255,255,1), 0 0 20px rgba(255,255,255,1), 0 0
30px rgba(255,255,255,1),  0 0 40px #ff00de, 0 0 70px
#ff00de, 0 0 80px #ff00de,  0 0 100px #ff00de;
}

80% {
text-shadow:0 0 2px rgba(255, 255, 255, .1), 0 0 10px
rgba(255, 255, 255, .4);
text-stroke: 2px
rgba(255,255,255,0.05);
}

100% {
text-shadow: 0 0 2px
rgba(255,255,255,1), 0 0 10px rgba(255,255,255,1), 0 0
20px rgba(255,255,255,1), 0 0 30px rgba(255,255,255,1),0
0 40px #ff00de,0 0 70px #ff00de, 0 0 80px #ff00de, 0 0
100px #ff00de;
}

}

This is the html:

 <div class="lasvegas"> Neon text 
f<span>ro</span>m<br> Las <span 
class="delay">V</span>egas </div>

It should be pink and flash in two different places, at different intervals, like a glowing, flashing neon sign. It's for an events page in wordpress. Im just wondering what I'm missing out here because it should work. All the code is right.

Upvotes: 1

Views: 880

Answers (1)

Aaron
Aaron

Reputation: 1727

 @import
 url(//fonts.googleapis.com/cssfamily=Pacifico);
 body {
 min-height:100vh;
 padding-top:5rem;
 background:
 #112
 url(//images.weserv.nl/url=i.imgur.com/6QJjYMe.jpg)
 center no-repeat;
 background-size: cover;
 margin: 0;
 overflow:hidden;
 }

.lasvegas {
font-family: 'Pacifico', cursive;
font-size:80px;
border: none;
color: rgba(255,255,255,0.6);
text-align:
center;
text-shadow: 1px 5px 4px rgba(0,0,0,.3), 0 0 2px
rgba(255,255,255,1), 0 0 10px
rgba(255,255,255,1),  0 0 20px rgba(255,255,255,1), 0 0
30px rgba(255,255,255,1),  0 0 40px #ff00de,0 0 70px
#ff00de,  0 0 80px #ff00de, 0 0 100px #ff00de;
 }
 .lasvegas
 span {
animation: blink .3s infinite alternate;
}
.lasvegas
span.delay {
animation-duration:6s;
animation-delay: 2s
animation-direction: alternate
cubic-bezier(0.5, 0.2, 0.3,
1.0)
}

@keyframes blink {
0%  {
}

50% {
}

60% {
text-shadow:0 0
2px rgba(255, 255, 255, .1), 0 0 10px rgba(255, 255, 255, .
4); text-stroke: 2px rgba(255,255,255,0.05);
}

70% {
text-
shadow: 0 0 2px rgba(255,255,255,1), 0 0 10px.
rgba(255,255,255,1), 0 0 20px rgba(255,255,255,1), 0 0
30px rgba(255,255,255,1),  0 0 40px #ff00de, 0 0 70px
#ff00de, 0 0 80px #ff00de,  0 0 100px #ff00de;
}

80% {
text-shadow:0 0 2px rgba(255, 255, 255, .1), 0 0 10px
rgba(255, 255, 255, .4);
text-stroke: 2px
rgba(255,255,255,0.05);
}

100% {
text-shadow: 0 0 2px
rgba(255,255,255,1), 0 0 10px rgba(255,255,255,1), 0 0
20px rgba(255,255,255,1), 0 0 30px rgba(255,255,255,1),0
0 40px #ff00de,0 0 70px #ff00de, 0 0 80px #ff00de, 0 0
100px #ff00de;
}

}
<div class="lasvegas"><span> Neon text 
from<br></span> <span class="delay">Las Vegas</span> </div>

I don't know what you want to see exactly but it behaves like you defined it:

fROm flashes fast. The V from Vegas flashes slowly.

Please be more specific with your question.

Edit: now it flashes slower after the line break..

Upvotes: 2

Related Questions