如何使按钮在列的宽度上伸展 [英] How to make a button stretch across the width of a column

查看:78
本文介绍了如何使按钮在列的宽度上伸展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使按钮跨栏的宽度。

I'm trying to make a button span the width of a column.

例如此处: http://davidnhutch.com 。注意浅灰色的按钮如何仅与它们包含的文本一样大?我希望每个按钮都可以跨越该列的宽度,但是我一生都无法弄清楚该如何做。我已经做了很多环顾四周的工作,但还是有点陌生​​。

e.g. here: http://davidnhutch.com. Notice how the light grey buttons are only as large as the text they contain? I'd like each button to span the width of that column, but can't for the life of me figure out how to do it. I've done quite a bit of looking around but am still kinda new to this.

有什么想法吗?

推荐答案

您必须将它们设置为块元素才能设置宽度:

You will have to make them block elements to be able to set a width:

.button {
    display: block;
    width: 100%;
}

这篇关于如何使按钮在列的宽度上伸展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆