HTML/CSS 左右 div 在 Chrome 上并排,但在 Safari/Firefox 上不是

标签 html css google-chrome safari alignment

我很难在 Firefox 和 Safari 中并排对齐 div,但在 Chrome 中效果很好。很难给出所有的 css,因为我有一个移动样式表,一个普通样式表,然后是有问题的打印样式表。其他样式表效果很好。如果需要更多信息来解决此问题,请告诉我。

我的网站在 http://bidonmoving.com/Template1/website.php了解更多详情

Chrome 页面的图像: http://bidonmoving.com/Resify/Resumes/Template1/images/chrome.png

Firefox 页面的图像: http://bidonmoving.com/Resify/Resumes/Template1/images/firefox.png

我的 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/

相关文章:

javascript - anchor 在 chrome 和 safari 浏览器中不起作用

javascript - 奇怪的 JavaScript 排序错误

php - 通过 PHP 检索存储在 MySQL 数据库中的本地路径,在本地主机上显示图像

CSS/BOOTSTRAP : making element inside the gird (. 容器/.row) 全(屏幕)宽度

添加 img 标签时 css 显示表格布局中断

styles - 当悬停 <li> 与其同级元素重叠时,如何获得阴影?

html - 是否有允许在桌面上使用自定义样式选项但在移动设备上具有 native 行为的 Dropdown 组件?

javascript - 如何检查表单元素是否为空?

html - Bootstrap 4 - 行和其他行之间的填充(768px 宽度)

javascript - 在用户信息前插入值