用图片显示出来
时间: 2023-09-02 08:09:46 浏览: 42
好的,这里是使用图片的示例代码:
HTML代码:
```html
<div class="arrow-button">
<a href="#">Button</a>
<img class="arrow" src="arrow.png">
</div>
```
CSS代码:
```css
.arrow-button {
position: relative;
display: inline-block;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border-radius: 4px;
}
.arrow-button .arrow {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
display: inline-block;
width: 10px;
height: 10px;
}
.arrow-button:hover .arrow {
transform: translateY(-50%) rotate(180deg);
}
.arrow-button:hover {
background-color: #3e8e41;
}
```
在上面的代码中,我们使用一个图片来代替箭头,图片的路径是 `arrow.png`,你可以根据需要修改图片的路径和大小。当鼠标悬浮在按钮上时,我们使用 CSS 的 `transform` 属性来旋转图片,使其看起来像是箭头指向上方。