In CSS, you can use the animation attribute and @keyframes rule to set up and down floating animation effects for the img picture element to make the pattern float up and down; the speed of the animation can be adjusted by the height of the element and the number of seconds in the animation.
The operating environment of this tutorial: Windows 7 system, HTML5&&CSS3 version, Dell G3 computer.
Recommended:css video tutorial
css3 implements a floating animation effect (animation)
CSS
@keyframes movepoint { 25% { top: 16px } 100%, { top: 50px } } .shade-button-point { display: inline-block; position: absolute; top: 50px; left: 30%; animation: movepoint 2s infinite; -webkit-animation: movepoint 2s infinite; }
HTML
Rendering:
For more programming-related knowledge, please visit:Programming Teaching! !
The above is the detailed content of How to make the pattern float up and down in css. For more information, please follow other related articles on the PHP Chinese website!