Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS or image for submit button?

Tags:

css

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="Content/Images/Remove.png" />
    
like image 572
Shawn Mclean Avatar asked Aug 26 '26 13:08

Shawn Mclean


1 Answers

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"

like image 114
shanethehat Avatar answered Aug 28 '26 05:08

shanethehat