我的模态布局遇到问题。基本上我想要一个主面板和一个始终保持相同高度的侧边栏面板。也就是说,它们将100%的高度扩展到容器的底部。任何帮助将不胜感激!
@main {
<div class="row-fluid">
<div class="modal hide" id="myModal">
<!-- Main Window -->
<div class="panel panel-primary span10" style="float:left">
<div class="modal-header panel-heading">
<h1 class="panel-title">Pick Category</h1>
</div>
<div class="modal-body">
<div class="row-fluid text-center">
@for(cate <- cates) {
<div class="span3 fix">
<a href="@routes.Builder.pickItem(cate.id)" class="img-polaroid thumbnail"><img type="image" src="@routes.Assets.at(cate.getImageUrl())"></a>
<h4 class="@cate.getFontColor()">@cate.getName()</h4>
</div>
}
</div>
</div>
<div class="footer">
<a href="@routes.Builder.setLocation()"><input type="image" src="@routes.Assets.at("img/arrow_left.png")" type="button"></a>
</div>
</div>
<!-- Shopping Cart -->
<div class="panel panel-primary span2" style="float:right">
<div class="modal-header panel-heading">
<h1 class="panel-title">Cart</h1>
</div>
<div class="modal-body">
<h4>yoyoyo</h4>
<h4>yoyoyo</h4>
<h4>yoyoyo</h4>
</div>
</div>
<div style="clear: both"></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#myModal').modal('show');
slider.reloadSlider();
});
</script>
}
答案 0 :(得分:0)
你的左栏应该向左浮动,右栏应该向右浮动。在结束div标记到右列之后,您应该添加<div style="clear: both"></div>
或创建一个类并在div中调用该类。
答案 1 :(得分:0)
使用这种技术计算出来。
<强> CSS:强>
.col{
margin-bottom: -99999px;
padding-bottom: 99999px;
background-color:#ffffff;
}
.col-wrap{
overflow: hidden;
}
<强> CODE:强>
@main {
<div class="container-fluid">
<div class="modal hide clean" id="myModal">
<div class="row-fluid col-wrap">
<!-- Main Window -->
<div class="panel panel-primary span10 col">
<div class="modal-header panel-heading">
<h1 class="panel-title">Pick Category</h1>
</div>
<div class="modal-body">
<div class="row-fluid text-center">
@for(cate <- cates) {
<div class="span3 fix">
<a href="@routes.Builder.pickItem(cate.id)" class="img-polaroid thumbnail"><img type="image" src="@routes.Assets.at(cate.getImageUrl())"></a>
<h4 class="@cate.getFontColor()">@cate.getName()</h4>
</div>
}
</div>
<div class="footer">
<a href="@routes.Builder.setLocation()"><input type="image" src="@routes.Assets.at("img/arrow_left.png")" type="button"></a>
</div>
</div>
</div>
<!-- Shopping Cart -->
<div class="panel panel-primary span2 col" style="margin-left:10px">
<div class="modal-header panel-heading">
<h1 class="panel-title">Cart</h1>
</div>
<div class="modal-body">
<ul class="nav nav-tabs nav-stacked">
<li class="active"><a href="#">Turkey Hoagie</a></li>
<li><a href="#">-Lettuce</a></li>
<li><a href="#">-Mayo</a></li>
<li><a href="#">-Tomatoes</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>