html给按钮加图片

⌚Time: 2024-07-25 16:43:00

👨‍💻Author: Jack Ge

<style>
.imagebutton{
    /*取消原来的按钮样式*/
    background-color: transparent;
    border: 0;

    background-image:url('path/to/image.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    padding: 10px 20px;
}
</style>
<button class="imagebutton"></button>