我想使用CSS将3个div并排放置。我已经阅读了SO上的许多帖子,但是没有为我的项目使它们起作用。
#quotescointainer{
width: 100%;
font-size: 12px;
}
#quotesleft{
float:left;
width: 33%;
background-color: white;
}
#quotescenter{
background-color:white;
width: 33%;
}
#quotesright{
float:left;
width: 33%;
}
上述代码未将div放置在正确的位置。我似乎无法找出自己的错误。
float
的答案,就像OP的代码一样。 - thirtydotwidth: 33.33%
来解决这个问题,或者使用基于display: table
的方法。 - thirtydot