0

如何使用 CSS 拉伸表单提交按钮?我想在按钮内的文本和按钮左右端之间有某种水平填充。这可能吗?如果可以,怎么做?

替代文字

也非常感谢使按钮更漂亮(不使用图像)的提示:-)。

4

3 回答 3

2

增加width按钮的。

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

CSS:

.btn{
  width:250px; /* adjust value */
}
于 2010-08-27T14:21:08.753 回答
1

您可以像任何其他 HTML 元素一样设置它的样式,例如给它display:blockwidth:100%.

于 2010-08-27T14:22:07.147 回答
0

CSS:

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

在 IE6 中不起作用,因为它不读取 type="submit" 选择器,但适用于 IE7/8 和所有其他浏览器。

于 2010-08-27T14:30:20.763 回答