开发者

CSS or image for submit button?

What are the advantage and disadvantage of using both?

  1. CSS

    <input type="submit" class="removeBtn" />
    
    .removeBtn{
        background: url(Images/Remove.png);
        height: 25px;
        width: 25px;
    }
    
  2. Inline

    <input type="image" src="Conten开发者_Go百科t/Images/Remove.png" />
    


Semantically speaking, you should always use a submit button. A user with a screenreader will have no idea what the function of your image input is.

Edit: as per comments, the image button will automatically submit a form as well as an input with type="submit"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜