【发布时间】:2017-12-21 07:39:13
【问题描述】:
我正在尝试使用 Bootstrap 创建一个网站,当我尝试将两列并排放置时(它们一起出现在 bootstrap 中允许的 12 个列中),它们只是被挤在一起。我尝试为其中一列添加边距,但这只会导致较小的列包裹并最终位于较大的列之下。
<div class="container">
<div class="row">
<div class="col-sm-8s">
<div class="featuredPost">
<h2>Featured Post <hr></h2>
<img src="Images/placeholderImg.jpg" alt="Featured Image">
<p>
Portland aesthetic cardigan cloud bread brooklyn food truck blog leggings quinoa street art franzen. Fixie swag artisan ennui vaporware cred. Church-key direct trade neutra try-hard tilde typewriter selfies butcher trust fund. Aesthetic iceland small batch ugh health goth you probably haven't heard of them glossier fixie before they sold out fingerstache knausgaard cloud bread slow-carb. Man bun gluten-free sartorial, thundercats blog man braid banjo. Skateboard poke hot chicken pickled, tote bag tacos 90's..<a href="#">Read More »</a>
</p>
</div>
</div>
<aside class="authorBio col-sm-4">
<div class="widget">
<div class="row">
<img class="col-sm-6" src="Images/AimeeAvatar.jpg" alt="Avatar">
<h1 class="col-sm-6">Aimée LeVally</h1>
</div>
<hr>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur.
</p>
</div><!-- widget -->
</aside>
</div><!-- row -->
</div>
.authorBio {
background-color: #fff4e8;
padding: 15px 50px 30px 50px;
text-align: justify;
border: 5px solid #f7ddc0;
}
.authorBio h1 {
text-align: justify;
color: #ad4b34;
}
.authorBio img {
width: 50%;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
}
.featuredPost {
background-color: #fff4e8;
padding: 15px 50px 30px 50px;
text-align: justify;
border: 5px solid #f7ddc0;
}
.featuredPost img {
width: 100%;
padding: 0 0 0 0;
margin: 0;
}
.featuredPost p {
padding-top: 25px;
}
【问题讨论】:
标签: html css twitter-bootstrap