没有背景/边框的图像按钮? [已解决]

问题描述 投票:0回答:2

我一直在尝试从图像制作一个按钮,但我不知道如何从中删除边框和背景。有什么办法可以让图像充当按钮吗?

这是我当前的按钮

这是我的代码:

<a title="Go to the card store?" href="https://site"><button type="button"><img src="cardspin.gif" width="200" height="200"></button></a>

我尝试在 .css 文件中创建自定义按钮类,但它没有执行任何操作。这是我用来制作课程的代码。

.transparent_button {
  background-color: transparent;
  border: 0px;
    }

这是一种非常简单的类型,点击后只会进入我网站的另一个页面,如果这与它有任何关系的话......

html css button
2个回答
1
投票

对我来说,根据代码的实现,单击按钮的唯一功能是将您带到卡片商店。

按钮通常用于执行某种操作,例如提交搜索请求或将商品添加到购物清单。我看不到您提供的代码中所需的任何操作,因此我想说您实际上只需要锚标记:

<a title="Go to the card store?" href="https://site">
  <img src="cardspin.gif" width="200" height="200">
</a>

-1
投票

您需要将图像作为

.png
文件。您在 Photoshop 中删除背景。

© www.soinside.com 2019 - 2024. All rights reserved.