【发布时间】:2017-01-09 01:03:48
【问题描述】:
当使用 col-sm-6 时,我无法对齐图片和框文本。我不确定这是否是图像或边距/填充等问题。
html:
/* css: */
.category {
padding-top: 3rem;
padding-bottom: 3rem;
background-color: #096;
}
.categoryimg {
display: block;
height: 487px;
max-width: 100%;
}
.categorytext {
padding-top: 12%;
font-family: Avenir;
color: #0670EB;
font-weight: bold;
background-color: white;
width: 50%;
height: 487px;
float: right;
}
.categorytext1 {
padding-top: 12%;
font-family: Avenir;
color: #0670EB;
font-weight: bold;
background-color: white;
width: 50%;
height: 487px;
float: left;
}
<div class="container-fluid">
<div class="container">
<div class="row">
<div class="col-sm-6 categorytext1">
<h2>LANGUAGE</h2>
<p class="lead">Nibook is a platform where foreigners can change their frame time into money by crafting beautiful services and share them with the locals within in-person or online experiences.</p>
</div>
<div class="col-sm-6"> <img src="img/language.png" class="categoryimg" alt="Generic placeholder image"> </div>
</div>
</div>
</div>
</div>
下一张图片是我试图实现的。我尝试逐行放置 1 个 img 和 1 个文本框,并将其作为一个表格,每个框之间都有填充。我不知道如何解决这个问题。
【问题讨论】: