gpt4 book ai didi

html - 如何制作透明的HTML按钮?

转载 作者:技术小花猫 更新时间:2023-10-29 11:27:56 31 4
gpt4 key购买 nike

我正在使用 Dreamweaver 创建网站,我想只使用 Photoshop 来创建背景。我决定这样做只是因为万一我选择通过编辑代码轻松更改按钮名称,我可以只引用代码。如果我使用 Photoshop 构建按钮,我将无法轻松编辑这些按钮或任何元素中的文本。

所以我的问题很简单,如何创建一个具有简单内联样式的按钮,使其透明并使按钮的值仍然可见。

.button {     
background-color: Transparent;
background-repeat:no-repeat;
border: none;
cursor:pointer;
overflow: hidden;
}

点击后它仍然会留下边框阴影。

最佳答案

要在点击时去掉轮廓,添加outline:none

JSFiddle example

button {
background-color: transparent;
background-repeat: no-repeat;
border: none;
cursor: pointer;
overflow: hidden;
outline: none;
}

button {
background-color: transparent;
background-repeat: no-repeat;
border: none;
cursor: pointer;
overflow: hidden;
outline: none;
}
<button>button</button>

关于html - 如何制作透明的HTML按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22672368/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com