This article will introduce how to use CSS to achieve the effect of QR code scanning. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
The effect of scanning the QR code, I thought it was difficult to write, but then I thought about it, it is actually quite simple, just a few lines of code, and it works
<p class="code-bg"><br/> <p class="line"></p><br/></p><br/>
.code-bg{<br/> position: relative; <br/> height: 200px; width: 200px; <br/> margin: 0px auto;/*此处为了居中*/<br/> background: url(img/ewm1.jpg) center top no-repeat; /*二维码*/<br/> }<br/> .line{ <br/> position: absolute; <br/> left: -80px; <br/> z-index: 2; <br/> height: 3px; width: 360px; <br/> background: url(img/share/dapai.png) no-repeat; /*上下扫的线*/<br/> /*动画效果*/<br/> animation: myScan 1s infinite alternate; <br/> -webkit-animation: myScan 1s infinite alternate; <br/> }<br/> @keyframes myScan{<br/> from { top:0px; }<br/> to { top: 197px; }<br/> }<br/> -webkit-@keyframes myScan{<br/> from { top:0px; }<br/> to { top: 197px; }<br/> }<br/>
It is not convenient for me to take screenshots here, so That's it, isn't it?
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study. For more related tutorials, please visit CSS Video Tutorial!
Related recommendations:
php public welfare training video tutorial
The above is the detailed content of CSS realizes the effect of QR code scanning. For more information, please follow other related articles on the PHP Chinese website!