开发者

How to stretch the form submit button using CSS?

开发者 https://www.devze.com 2023-01-13 03:29 出处:网络
how do I stretch a form submit button using CSS? I\'d like to have some kind of horizontal padding between the text inside the button and the button left and right end. Is this possible, and if so, ho

how do I stretch a form submit button using CSS? I'd like to have some kind of horizontal padding between the text inside the button and the button left and right end. Is this possible, and if so, how?

How to stretch the form submit button using CSS?

Tips for making the button prettier (without using images) a开发者_开发问答re also much appreciated :-).


Increase the width of the button.

<input type="submit" class="btn" />

CSS:

.btn{
  width:250px; /* adjust value */
}


You can style it like any other HTML element, for example give it display:block and width:100%.


CSS:

input[type="submit"] {width: 100%;} /* to stretch all submit buttons to full page width, or use width: 300px; as Sarfraz suggested. */

does not work in IE6 cause it does not read type="submit" selector, but works on IE7/8 and all other browsers.

0

精彩评论

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