html css图片炫酷效果,5种CSS3 Transitions炫酷图片标题特效
时间: 2024-03-07 11:47:28 浏览: 141
好的,我会根据您的问题为您提供回答。以下是5种CSS3 Transitions炫酷图片标题特效的示例:
1. 渐变效果
```html
<div class="box">
<h2>标题</h2>
</div>
.box {
background: linear-gradient(to right, #f00, #00f);
display: inline-block;
padding: 20px;
transition: background 0.5s ease;
}
.box:hover {
background: linear-gradient(to right, #00f, #f00);
}
```
2. 旋转效果
```html
<div class="box">
<h2>标题</h2>
</div>
.box {
transform: rotate(0deg);
transition: transform 0.5s ease;
}
.box:hover {
transform: rotate(360deg);
}
```
3. 缩放效果
```html
<div class="box">
<h2>标题</h2>
</div>
.box {
transform: scale(1);
transition: transform 0.5s ease;
}
.box:hover {
transform: scale(1.2);
}
```
4. 抖动效果
```html
<div class="box">
<h2>标题</h2>
</div>
.box {
position: relative;
transition: left 0.1s ease-in-out;
}
.box:hover {
left: 5px;
}
.box:hover:before {
content: '';
position: absolute;
top: 0;
left: -5px;
width: 5px;
height: 100%;
background: #f00;
animation: shake 0.1s linear infinite;
}
@keyframes shake {
0% { transform: translate(0, 0); }
25% { transform: translate(-5px, 0); }
50% { transform: translate(0, 0); }
75% { transform: translate(5px, 0); }
100% { transform: translate(0, 0); }
}
```
5. 模糊效果
```html
<div class="box">
<h2>标题</h2>
</div>
.box {
filter: blur(0);
transition: filter 0.5s ease;
}
.box:hover {
filter: blur(5px);
}
```
希望这些示例能够帮助您实现想要的效果。
阅读全文