Sharing of Five Commonly Used CSS3 Web Page Small Effects
This article will share with you 5 very commonly used CSS3 web page effects. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Tutorial recommendation: css video tutorial
First effect:
#Since recording gif pictures will drop frames, it looks unsmooth and stuck, but in fact the actual effect is still good and more flexible.
html code:
<span class="shake">弹</span>
css code:
.shake{ width:40px; height:40px; display:block; background:lightgreen; border-radius:50%; margin:5px; color:#fff; font-size:24px; text-align:center; line-height:40px; cursor:pointer; -webkit-transition:all 0.25s; } .shake:hover{ -webkit-animation:shake 0.25s; background: lightblue; } @-webkit-keyframes shake{ 0%,10%,55%,90%,94%,98%,100%{ -webkit-transform:scale(1,1); } 30%{ -webkit-transform:scale(1.14,0.86); } 75%{ -webkit-transform:scale(0.92,1.08); } 92%{ -webkit-transform:scale(1.04,0.96); } 96%{ -webkit-transform:scale(1.02,0.98); } 99%{ -webkit-transform:scale(1.01,0.99); } }
I saw a reply to someone’s personal blog website last night The floating effect of the button at the top looks like this. It’s quite interesting, but other people’s effects may be better than mine, so you might as well give it a try.
The second effect:
This effect is actually used by many online websites. Yes, it can be achieved whether using CSS3 or jQuery. So here I just simply use CSS3 to achieve it.
html code:
<input class="search" type="text" placeholder="搜索...">
CSS code:
.search{ width:80px; height:40px; border-radius:40px; border:2px solid lightblue; position: absolute; right:200px; outline:none; text-indent:12px; color:#666; font-size:16px; padding:0; -webkit-transition:width 0.5s; } .search:focus{ width:200px; }
Usually there will be a button next to it, but I won’t do it here. .
The third effect:
This effect is also very commonly used, mostly on personal websites Too much.
html code:
<div class="banner"> <a href="javascript:;">博</a> <span>这是我的个人博客</span> </div>
css code:
.banner{ width:234px; height:34px; border-radius:34px; position:absolute; top:400px; left:200px; } .banner a{ display:inline-block; width:30px; height:30px; line-height:30px; border-radius:50%; border:2px solid lightblue; position:absolute; left:0px;top:0px; background:lightgreen; color:#fff; text-align:center; text-decoration:none; cursor:pointer; z-index:2; } .banner a:hover + span{ -webkit-transform:rotate(360deg); opacity:1; } .banner span{ display:inline-block; width:auto; padding:0 20px; height:34px; line-height:34px; background:lightblue; border-radius:34px; text-align: center; position:absolute; color:#fff; text-indent:25px; opacity:0; -webkit-transform-origin:8% center; -webkit-transition:all 1s; }
Fourth effect:
#This prompt effect is more commonly used and is used by many websites.
html code:
<div> <a>博</a> <span>这是我的个人博客</span> </div>
css code:
.banner1{ width:234px; height:34px; border-radius:40px; position:absolute; top:400px; left:600px; } .banner1 a{ display:inline-block; width:30px; height:30px; line-height:30px; border-radius:50%; border:2px solid lightblue; position:absolute; left:0px;top:0px; background:lightgreen; color:#fff; text-align:center; text-decoration:none; cursor:pointer; z-index:2; } .banner1 a:hover + span{ -webkit-transform:translateX(40px); opacity:1; } .banner1 span{ display:inline-block; width:auto; padding:0 20px; height:30px;line-height:30px; background:lightblue; border-radius:30px; text-align: center; color:#fff; position:absolute; top:2px; opacity:0; -webkit-transition:all 1s; -webkit-transform:translateX(80px); }
The fifth effect:
I guess this is not commonly used anymore. I’m just making it for fun. If you’re interested, take a look:
html structure:
<div class="wrapper"> <div class="round"> <span>东邪</span> <span>西毒</span> <span>南乞</span> <span>北丐</span> </div> </div>
css code:
.wrapper{ width:100px; height:100px; background:lightblue; border-radius:50%; border:2px solid lightgreen; position: absolute; top:200px; left:400px; cursor:pointer; } .wrapper:after{ content:'你猜'; display:inline-block; width:100px; height:100px; line-height:100px; border-radius:50%; text-align:center; color:#fff; font-size:24px; } .wrapper:hover .round{ -webkit-transform:scale(1); opacity:1; -webkit-animation:rotating 6s 1.2s linear infinite alternate; } @-webkit-keyframes rotating{ 0%{ -webkit-transform:rotate(0deg); } 100%{ -webkit-transform:rotate(180deg); } } .round{ width:240px; height:240px; border:2px solid lightgreen; border-radius:50%; position: absolute; top:-70px; left:-70px; -webkit-transition:all 1s; -webkit-transform:scale(0.35); opacity:0; } .round span{ width:40px; height:40px; line-height:40px; display:inline-block; border-radius:50%; background:lightblue; border:2px solid lightgreen; color:#fff; text-align:center; position:absolute; } .round span:nth-child(1){ right:-22px; top:50%; margin-top:-22px; } .round span:nth-child(2){ left:-22px; top:50%; margin-top:-22px; } .round span:nth-child(3){ left:50%; bottom:-22px; margin-left:-22px; } .round span:nth-child(4){ left:50%; top:-22px; margin-left:-22px; }
Conclusion
So this time Let me share these few gadgets. I will share some better ones when I have time in the future.
For more programming related knowledge, please visit: Programming Video! !
The above is the detailed content of Sharing of Five Commonly Used CSS3 Web Page Small Effects. For more information, please follow other related articles on the PHP Chinese website!

For a while, iTunes was the big dog in podcasting, so if you linked "Subscribe to Podcast" to like:

We lost Opera when they went Chrome in 2013. Same deal with Edge when it also went Chrome earlier this year. Mike Taylor called these changes a "Decreasingly

From trashy clickbait sites to the most august of publications, share buttons have long been ubiquitous across the web. And yet it is arguable that these

In this week's roundup, Apple gets into web components, how Instagram is insta-loading scripts, and some food for thought for self-hosting critical resources.

When I was looking through the documentation of git commands, I noticed that many of them had an option for . I initially thought that this was just a

Sounds kind of like a hard problem doesn't it? We often don't have product shots in thousands of colors, such that we can flip out the with . Nor do we

I like when websites have a dark mode option. Dark mode makes web pages easier for me to read and helps my eyes feel more relaxed. Many websites, including

This is me looking at the HTML element for the first time. I've been aware of it for a while, but haven't taken it for a spin yet. It has some pretty cool and


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor