button image as form input submit button?

前端 未结 6 1261
孤独总比滥情好
孤独总比滥情好 2020-12-01 08:37
<
6条回答
  •  不知归路
    2020-12-01 09:30

    Late to the conversation...

    But, why not use css? That way you can keep the button as a submit type.

    html:

    
    

    css:

    button, input[type="submit"] {
        background:url(/images/submit.png) no-repeat;"
    }
    

    Works like a charm.

    EDIT: If you want to remove the default button styles, you can use the following css:

    button, input[type="submit"]{
        color: inherit;
        border: none;
        padding: 0;
        font: inherit;
        cursor: pointer;
        outline: inherit;
    }
    

    from this SO question

提交回复
热议问题
User ID: