在我的网格中,在列内,我有2个div,它们都是内联块。问题是当文本很长时,它会移到左侧并且没有正确对齐。我甚至尝试将它从内联块更改为两个div到float:left但它并没有什么区别。
我希望它像右边的2列一样对齐,但是一旦文本变长,它就不会换行,但会被移位。
使用html5进行演示: http://codepen.io/anon/pen/OPRwPr
HTML:
<header>
</header>
<main class="contain">
<div class="row">
<div class="col-1-3">
<div class="title px30 lh60 pad-left-hard">
Some Title
</div>
<div class="content pad-left-hard">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
</p>
</div>
</div>
<div class="col-1-3">
<div class="title px30 lh60 pad-left-hard">
Some Title
</div>
<div class="content pad-left-hard">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
</p>
</div>
</div>
<div class="col-1-3">
<div class="title px30 lh60 pad-left-hard">
Some Title
</div>
<div class="content pad-left-hard">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut eos doloribus ea enim, iure porro inventore, architecto illum accusamus, esse modi. Laudantium iure deleniti, earum ducimus, ullam reprehenderit rerum. Nemo.
</p>
</div>
</div>
</div>
</main>
<footer>
</footer>
的CSS:
body {
margin: 0;
padding: 0;
}
.splash-container {
position: relative;
display: none;
width: 100%;
height: 10px;
background-size: cover;
background-image: url("../img/clouds.jpg");
}
.menu-container {
height: 50px;
//background: #2B2B2B;
position: fixed;
top: 0;
z-index: 1;
width: 100%;
}
.splash-logo {
height: 400px;
}
.splash-image-container {
position: absolute;
width: 100%;
height: 200px;
text-align: center;
}
.main-points {
min-height: 450px;
background: #222;
padding: 75px;
}
.points-container {
width: 100%
}
.points-icon {
display: inline-block;
color: #069076;
vertical-align: top;
}
.points-text {
vertical-align: top;
display: inline-block;
color: white;
padding: 3px 0px 0px 20px;
}
.points-title {
font-size: 18px;
font-weight: bold;
margin: 0;
}
.points-desc {
font-size: 14px;
margin: 0;
padding: 0;
color: #999;
}
答案 0 :(得分:1)
演示 - http://codepen.io/anon/pen/vEXazb
为pull-left
添加.points-icon
课程,为display-table:cell
添加.points-text
答案 1 :(得分:0)