我有三個div,我想在一個頁面中並排放置。我也有一些內容,如<p>
和<h3>
標籤他們並排居中三個div
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;
}
這樣做的結果只是3個div的所有浮動主要用於將剩下。我想把他們三個都放在頁面上。