Effect The effect is as follows
Implementation ideas
DOM structure Use two nested div containers. The parent container controls the display position of the icon, and the child container is used to write the style of the dark clouds. <div class="container"> <div class="cloudy"></div> </div> CSS Styles 1. Parent container style, add a background color to the entire page for easy preview body{ background: rgba(73, 74, 95, 1); } .container{ width: 170px; height: 170px; position: relative; margin: 250px auto; } 2. The style of dark clouds, the dark clouds have an animation of moving up and down. The key here is the use of the box-shadow property. If it is white, it can be used as a cloudy weather icon. .cloudy{ width: 50px; height: 50px; position: absolute; top: 70px; left: 80px; margin-left: -60px; background: #ccc; border-radius: 50%; box-shadow: #ccc 65px -10px 0 -5px, #ccc 25px -25px, #ccc 30px 10px, #ccc 60px 15px 0 -10px, #ccc 85px 5px 0 -5px; animation: cloudy 5s ease-in-out infinite; } @keyframes cloudy{ 50%{ transform: translateY(-20px); } } 3. For the projection style, you can use the after pseudo element. Don’t forget that there is also a moving animation. .cloudy::after{ content: ''; width: 120px; height: 15px; position: absolute; bottom: -60px; left: 5px; background: #000; border-radius: 50%; opacity: 0.2; animation: cloudy-shadow 5s ease-in-out infinite; transform: scale(0.7); } @keyframes cloudy-shadow 50%{ transform: translateY(20px) scale(1); opacity: 0.05; } } OK, done. Follow the steps and you can also implement the cloudy weather icon on your page~ Summarize The above is the pure CSS that I introduced to you to achieve the cloudy weather icon effect. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: 10 skills that make front-end developers worth millions
>>: Solution to Django's inability to access static resources with uwsgi+nginx proxy
To use Nginx under Windows, we need to master som...
The EXPLAIN statement provides information about ...
The default template method is similar to vue2, u...
Because I need to use Ubuntu+Python 3.6 version t...
This article shares with you the specific code of...
Table of contents 1. What is the life cycle 2. Lo...
Any number of statements can be encapsulated thro...
Combining the various problems I encountered in m...
Win10 installs mysql5.7 decompressed version, for...
Table of contents What is axios? Axios request ty...
The BGCOLOR attribute can be used to set the back...
The image can be saved on hub.docker.com, but the...
Debug branch During the normal development of a p...
In cells, dark border colors can be defined indiv...
Table of contents 1. Vue Overview Vue official we...