Is there a way to get a <button> element to link to a location without wrapping it in an <a

后端 未结 8 1983
礼貌的吻别
礼貌的吻别 2020-12-02 06:49

Just wondering if there is a way to get a HTML

8条回答
  •  攒了一身酷
    2020-12-02 07:25

    Well, for a link, there must be a link tag around. what you can also do is that make a css class for the button and assign that class to the link tag. like,

    #btn {
      background: url(https://image.flaticon.com/icons/png/128/149/149668.png) no-repeat 0 0;
      display: block;
      width: 128px;
      height: 128px;
      border: none;
      outline: none;
    }

提交回复
热议问题