我很难在 Firefox 和 Safari 中并排对齐 div,但在 Chrome 中效果很好。很难给出所有的 css,因为我有一个移动样式表,一个普通样式表,然后是有问题的打印样式表。其他样式表效果很好。如果需要更多信息来解决此问题,请告诉我。
我的网站在 http://bidonmoving.com/Template1/website.php了解更多详情
Chrome 页面的图像:
Firefox 页面的图像:
我的 HTML 设置基本上如下:
<div class="page">
<div class="content">
<div class="left-content"></div>
<div class="right-content"></div>
</div>
</div>
CSS 是:
.page {
clear:both;
background-image: none;
background-color:none;
margin: 50px auto;
margin-left:30px;
border:0;
outline:none;
}
.content {
clear: both;
margin: 0px auto;
width: 1000px;
background: #ccc;
position: relative;
border:0;
outline:0;
-webkit-box-shadow:none;
-webkit-box-shadow:none;
}
.left-content{
width:450px;
text-align:left;
}
.right-content{
width:450px;
position:absolute;
margin-top:0px;
padding-top:0px;
margin:0px;
}
最佳答案
将你的 css 更改为 -
.left-content{
width:450px;
text-align:left;
float:left;
}
.right-content{
width:450px;
float:right; (or float:left and some margin-left)
}
关于HTML/CSS 左右 div 在 Chrome 上并排,但在 Safari/Firefox 上不是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24145561/