HTML CSS隐形按钮 [英] HTML CSS Invisible Button

查看:2672
本文介绍了HTML CSS隐形按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我试图让一个不可见的按钮(仍然功能齐全,可点击),因为我的按钮样式被嵌入在后台,我不想切片他们,做这一切的开始。

Hello I am trying to make an invisible button (still functional and clickable), because my buttons styles are embedded in the background and I don't want to slice them, and do it all from beginning.

所以,我只想做一个按钮,把它的背景所在的按钮应,并使其不可见这样的背景按钮图像可以看到和点击的一部分。

So I just want to make a button, put it on the part of the background where the button should be and make it invisible so the background button image can be seen and clicked.

有什么建议?非常感谢你!

Any suggestions? Thank you very much!

推荐答案

您必须使用以下属性为按钮元素,使之透明。

you must use the following properties for a button element to make it transparent.

button {

    background: transparent;
    border: none !important;
    font-size:0;
}

透明按钮使用可见文本

button {

    background: transparent;
    border: none !important;
}​

和使用绝对位置的元素的位置。

and use absolute position to position the element.

你有一个div下的按钮元素。使用位置:对股利和位置相对的:绝对上的按钮的div中定位

you have the button element under a div. Use position : relative on div and position: absolute on the button to position it within the div.

下面是一个工作的jsfiddle

下面是显示从按钮只有文字。更新的jsfiddle

here is an updated JSFiddle that displays only text from the button.

这篇关于HTML CSS隐形按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆