我有三个div,我想让它们并排居中在页面上。我还在其中放置了一些内容,例如
HTML(示例)
<p>
和<h3>
标签。HTML(示例)
<div id = "wrapper">
<div class = "aboutleft">
<h1> About us </h1>
<h3> small description </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tristique non odio nec
A few sentences about you go here
</p>
</div>
<div class = "vline"></div>
<div class = "aboutright">
<h1> About the shop/Clients </h1>
<h3> small description </h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tristique non odio ne
A few sentences about you go here
</p>
</div>
</div>
CSS
.aboutleft
{
display:inline-block;
float:left;
width: 450px;
}
#wrapper
{
text-align:center;
width: 80%;
margin: 0, auto;
}
.aboutright
{
display: inline-block;
float:right;
width: 450px;
}
.vline
{
background: rgb(186,177,152);
display: inline-block;
float: left;
min-height: 250px;
margin: 0 30px;
width: 1px;
}
结果是三个div都大多浮动到了左边。我想把它们三个居中放在页面上。