在bootstrap栅格系统中,如何将图片垂直居中
<divclass="panelpanel-primarycol-md-6"><divclass="panel-heading">最新活动</div><divclass=...
<div class="panel panel-primary col-md-6">
<div class="panel-heading">最新活动</div>
<div class="panel-body">
<div class="row" >
<div class="col-md-6" style="">
<img class="img-thumbnail" src= "img/1.jpg" alt="Alternate Text" /> <!--将这张图片垂直居中-->
</div>
<div class="col-md-6">
<ul>
<li><h1>asdfasdfadf</h1></li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
</ul>
</div>
</div>
</div>
</div> 展开
<div class="panel-heading">最新活动</div>
<div class="panel-body">
<div class="row" >
<div class="col-md-6" style="">
<img class="img-thumbnail" src= "img/1.jpg" alt="Alternate Text" /> <!--将这张图片垂直居中-->
</div>
<div class="col-md-6">
<ul>
<li><h1>asdfasdfadf</h1></li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
<li>asdfasdfadf</li>
</ul>
</div>
</div>
</div>
</div> 展开
2016-04-19
展开全部
垂直居中只能使用这个代码
.center-vertical {
position:relative;
top:50%;
transform:translateY(-50%);
}
.center-vertical {
position:relative;
top:50%;
transform:translateY(-50%);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询