【发布时间】:2015-09-11 16:07:45
【问题描述】:
我遇到了包含 span 元素的段落的高度问题:
这是 HTML 的设置:
<div class="container" id="container">
<div id="captionRegion" class="captionRegion"
style="left: 10%; top: 10%; width: 80%; height: 80%;
align-items: flex-end; background-color: rgb(0, 128, 0);">
<div class="paragraph" style="justify-content: center; text-align: center;
background-color: rgb(255, 0, 0); line-height: initial;">
<div class="innerContainer">
<span style="color: rgb(255, 255, 255); font-size: 38.4px;
font-family: monospace; background-color: rgb(0, 0, 0);">
One line Subtitle.
</span>
</div>
</div>
</div>
</div>
CSS:
.container{
width:160vh; /* 16:9 */
height:90vh; /* 16:9 */
position: absolute;
display: flex;
overflow: hidden;
margin: 0;
font-size: 6vh;
}
.captionRegion{
position: absolute;
z-index: 2147483647;
margin: 0;
display: flex;
}
.paragraph{
display: flex;
width: 100%;
}
我正在使用弹性盒子。 知道如何使红色段落适合跨度行高大小吗? 谢谢。
【问题讨论】:
-
可以设置段落高度