HTML CSS Invisible Button

后端 未结 5 1592
星月不相逢
星月不相逢 2020-12-03 05:42

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

5条回答
  •  天命终不由人
    2020-12-03 06:17

    button {
        background:transparent;
        border:none;
        outline:none;
        display:block;
        height:200px;
        width:200px;
        cursor:pointer;
    }
    

    Give the height and width with respect to the image in the background.This removes the borders and color of a button.You might also need to position it absolute so you can correctly place it where you need.I cant help you further without posting you code

    To make it truly invisible you have to set outline:none; otherwise there would be a blue outline in some browsers and you have to set display:block if you need to click it and set dimensions to it

提交回复
热议问题