0

我是div的新手,所以请原谅我的粗鲁。

我希望两个 div 居中,它们之间有空间,所以它们不会接触。

CSS -

#div1 {
margin: 0px auto 0px;
float: left;
height: 500px;
width: 339px;
}
#div2 {
margin: 0px auto 0px;
float: left;
height: 500px;
width: 400px;
}

HTML -

<div id="div1">
<p>Image 339 x 500 to go here</p>
</div>

<div id="div2">
10-17-20 - Toronto, Ontario - Massey Hall<br />
11-21 Birmingham, England - National Indoor Arena<br />
11-22 Manchester, England - 02 Apollo Manchester<br />
11-24 Manchester, England - 02 Apollo Manchester<br />
11-25 London, England - The 02 Arena</p> 
</div>
4

1 回答 1

0
<div id="wrapper">
  <div id="left">left</div>
  <div id="right">right</div>
</div>

#wrapper {width:90%;margin:0 auto;}
#left {float:left;width:48%;margin-right:1%;}
#right {float:right;width:48%;margin-left:1%;}
于 2013-11-05T23:54:21.957 回答