How to edit the size of the submit button on a form?

后端 未结 10 819
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 05:13

Hi I don\'t want an image for my submit button so I have gone with the default submit button but I want to edit its width and height. How do I do that?



        
10条回答
  •  一整个雨季
    2020-12-24 05:31

    Using CSS you can set a style for that specific button using the id (#) selector:

    #search {
        width: 20em;  height: 2em;
    }
    

    or if you want all submit buttons to be a particular size:

    input[type=submit] {
        width: 20em;  height: 2em;
    }
    

    or if you want certain classes of button to be a particular style you can use CSS classes:

    
    

    and

    input.search {
        width: 20em;  height: 2em;
    }
    

    I use ems as the measurement unit because they tend to scale better.

提交回复
热议问题