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 can use <map> element instead.
You should add display: none; to yor button style to hide. this will not work! display:none will hide the entire button for sure, but will also hide the text of the button, as that is part of the button!
You can hide an element in CSS using the CSS properties display: none or visibility: hidden . display: none removes the entire element from the page and mat affect the layout of the page. visibility: hidden hides the element while keeping the space the same.
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.
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.
here is a working JSFiddle
here is an updated JSFiddle that displays only text from the button.
You can use CSS to hide the button.
button {
visibility: hidden;
}
If your <button>
is just a clickable area on the image, why bother make it a button? You can use <map>
element instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With