twitter-bootstrap Bootstrap 中一行的高度是多少?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37739950/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 23:58:43  来源:igfitidea点击:

What is the height of a row in Bootstrap?

twitter-bootstrapcss

提问by Izzo

I'm in the process of learning bootstrap and am struggling with row heights. Widths seem to be easy in bootstrap since rows typically span the entire window and column widths are explicitly declared.

我正在学习引导程序,并且正在努力解决行高问题。宽度在引导程序中似乎很容易,因为行通常跨越整个窗口,并且列宽是明确声明的。

However the height of rows and columns are much more confusing. So my questions:

然而,行和列的高度更令人困惑。所以我的问题:

What is the default height of a row in bootstrap? Is the row height dependent on the column with largest height? Is there a good way to explicitly define a row height? E.g. Make row height be 50% of container, etc.

bootstrap 中一行的默认高度是多少?行高是否取决于高度最大的列?有没有明确定义行高的好方法?例如,使行高为容器的 50% 等。

Any help would be appreciated!

任何帮助,将不胜感激!

采纳答案by warkentien2

What is the default height of a row in bootstrap?

bootstrap 中一行的默认高度是多少?

The heightnecessary to vertically encapsulate all child elements.
And width: inherit; max-width: 100vw;

height必要的垂直封装所有的子元素。
width: inherit; max-width: 100vw;

Container also has no height,
you would have to define one, in order to use .my-row { height: 50%; }

Container 也没有height
您必须定义一个,才能使用.my-row { height: 50%; }

Best practice:create your own class instead of messing with the css of a bootstrap class.

最佳实践:创建自己的类,而不是搞乱引导类的 css。

回答by Trojan

you can set the height and width of html and body to 100%

你可以将html和body的高度和宽度设置为100%