<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
*{
margin: 0
padding: 0
}
body{
background-color: #000
}
a{
width: 200px
height: 50px
display: block
text-align: center
line-height: 50px
text-decoration: none
position: absolute
top: 50%
left: 50%
transform: translate(-50%,-50%)
font-size: 24px
font-weight: bold
color: white
border: 1px solid white
overflow: hidden
}
a::before{
content: ""
position: absolute
top: 0
left: -100%
width: 100%
height: 100%
background-image: linear-gradient(60deg,transparent,rgba(146,148,248,.4),transparent)
transition: all 0.5s
}
a:hover::before{
left: 100%
}
a:hover{
box-shadow: 0 2px 10px 8px rgba(146,148,248,.4)
}
</style>
</head>
<body>
<a href="#">鼠标悬停效果</a>
</body>
</html>
CSS+HTML<悬停下划线效果>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
display: flex
height: 100vh
justify-content: center
align-items: center
}
ul {
padding: 0
margin: 0
list-style-type: none
}
ul li{
padding: 5px 0
}
ul li a {
position: relative
display: inline-block
text-decoration: none
color: #3a3a3a
/* 转大写 */
text-transform: uppercase
padding: 4px 0
transition: 0.5s
font-weight: bold
}
ul li a::after {
position: absolute
content: ""
width: 100%
height: 3px
top: 100%
left: 0
background: #347cdb
transition: transform 0.5s
transform: scaleX(0)
transform-origin: right
}
ul li a:hover {
color: #585858
text-shadow: 0 0 10px #ccc
}
ul li a:hover::after {
transform: scaleX(1)
transform-origin: left
}
</style>
</head>
<body>
<ul>
<li><a href="#">home</a></li>
<li><a href="#">archives</a></li>
<li><a href="#">tags</a></li>
<li><a href="#">categories</a></li>
<li><a href="#">about</a></li>
</ul>
</body>
</html>
用gif图片来做loading的时代已经过去了,它显得太low了,而用HTML5/CSS3以及SVG和canvas来做加载动画显得既炫酷又逼格十足。这已经成为一种趋势。
这里收集了几十个用html5和css3实现的loading效果,以供学习参考。
01. CSS Rainbow Loader
02. Single element Slack loader
03. Pure CSS3 loader
04. CSS Cog loader
05. VSCO – CSS loader
06. Cube CSS Loader
07. CSS Loader
08. Tumblr-style cog loaders
09. CSS Weather Loader
10. Chrome Cast CSS Loader
11. CSS3 Loaders
12. Android 4.4 Kitkat loader
13. CSS loaders kit
14. CSS creative loading
15. CSS Loading Animation
16. Logo Loader
17. Loaders collection by Loaders.css
18. CSS Water filling Loader
19. CSS loader
20. Animated CSS3 Loading Bar
21. CSS loading text animation
22. Simple Loader
23. CSS Loading animation
24. CSS loader
25. Pushing pixels CSS loader
26. CSS Loader
27. CSS Loaders
28. Random Loader
29. Single element CSS spinners
30. Simple CSS loader
31. SpinKit – CSS loaders
32. Modern Google Loader
33. 2D and 3D Block Loaders
34. 12 free SVG loaders
35. Page Loading Effects
36. Pace.js – Page Load Progress Bars
37. Loading SVG loaders
38. Material Design preloader
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)