我试图在一个部分中显示一个列表。我使用的宽度/高度设置为100%结合box-sizing: border-box,但由于原因,我不明白的事情仍然是太宽。所讨论的html如下所示:
<main>
<section scrumboard="" class="scrumboard">
<ol class="lanes">
<li class="lane droppable">
<h1 class="lane-title">todo</h1>
</li>
....
</ol>
</section>
</main>和CSS:
html,body,main,section {
height: 100%;
width: 100%;
overflow: hidden;
box-sizing: border-box;
}
body {
padding: 20px;
}
.scrumboard {
background-color: #aaa;
}
.lanes {
box-sizing: border-box;
display: flex;
flex-wrap: nowrap;
font-size: 0;
height: 100%;
list-style-type: none;
margin: 50px 0 0;
padding: 0px;
}
.lane {
height: 100%;
border: 1px dashed black;
margin: 0 5px 10px 5px;
box-sizing: border-box;
display: inline-block;
text-align: center;
flex: 1 100%;
}
.lane-title {
font: 100 20px/40px 'Titillium Web';
margin-top: -35px;
color: #253248;
text-transform: uppercase;
}这里是一个小提琴,因此,我不明白为什么body元素上的填充在右侧下降,为什么li元素要长(底部的边框不可见)。有什么建议吗?
发布于 2014-03-22 08:39:51
https://stackoverflow.com/questions/22575273
复制相似问题