Rad*_*ola 7 html css vertical-alignment twitter-bootstrap
我需要将一个框对齐到引导列的左下方。谢谢你的帮助。
问题在于该列没有定义的高度。
您可以将列设置为flexbox,然后将元素对齐到末尾。
.row {
background: red;
}
.col-6-md {
background: lightblue;
height: 200px;
display: flex;
}
.bottom {
background: green;
align-self: flex-end;
width: 100px;
height: 50px;
}Run Code Online (Sandbox Code Playgroud)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-6-md">
<div class="bottom">Bottom</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
.bottomdiv {
border: 1px solid red;
height: 50px;
width: 50px;
position:absolute;
left:0;
bottom:0;
}
.col-md-6.col-sm-6.col-xs-6 {
display: table-cell;
height: auto;
border: 1px solid black;
float: none;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="parent">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="bottomdiv">
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
</div></div>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11953 次 |
| 最近记录: |