我有一行包含兩列,我希望行中的兩個單元格的高度相同。在屏幕截圖中,左側單元格比右側更小,因此我希望該單元格的高度與行相同。問題是,其中一個單元可能比它的鄰居大。Bootstrap - 將行的高度設置爲行高的100%
例與藍線以指示空間應該由:
行的片段是:
<div class="row center-block">
<div class="col-sm-4">
<div class="well-menu">
<ul class="nav">
<li>
<a title="Home" href="/">Home</a>
</li>
<li>
<a title="Contact" href="#">Contact</a>
</li>
<li>
<a title="Parent Portal" href="#">Parent Portal</a>
</li>
</ul>
</div>
</div>
<div class="visible-xs-block padding-top-10"></div>
<div class="col-sm-8">
<div id="subscribe-box" class="well-menu">
<form action="#">
<div class="input-group">
<h3>Subscribe to our newsletter:</h3>
<input class="btn btn-lg" name="email" id="email" type="email" placeholder="Your Email" required>
<button class="btn btn-info btn-lg" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
造型:
.well-menu {
padding: 0 18px;
line-height: 42px;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 7px;
background-clip: padding-box;
box-shadow: 0 1px 0px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(0, 0, 0, 0.5);
}
.well-menu>.nav>li {
float: left;
margin: 0;
}
.well-menu>.nav>li:first-child>a{
margin: 0 10px 0 0;
}
.well-menu>.nav>li:last-child>a{
margin: 0 0 0 10px;
}
.well-menu>.nav>li>a{
position: relative;
display: inline;
color: #DBDDDD;
padding: 0;
margin: 0 10px;
background: transparent;
}
.well-menu > .nav > li > a:hover{
color: #fff;
text-decoration: none;
}
.well-menu>.nav>li:not(:first-child):before{
display: inline-block;
content: "\2022";
float: left;
margin: 0 2px;
color:#DBDDDD !important;
}
可能重複[如何使Bootstrap列高度相同?](http://stackoverflow.com/questions/19695784/how-can-i-make-bootstrap-columns-all-the-same-高度) –
@MaksymStepanenko這不起作用,我已經將導航列表和「井式菜單」的高度設置爲100% –