【问题标题】:Formatting issue with Internet explorer and ChromeInternet Explorer 和 Chrome 的格式化问题
【发布时间】:2017-02-18 03:34:23
【问题描述】:

我已将列表格式化为三列带边框。当我使用 Firefox 查看该列表时,该列表的格式非常完美,但是当我在 Chrome 中查看该列表时,格式略有偏差,而使用 Internet Explorer 时,格式甚至更差。我正在寻求帮助确定如何使三种浏览器的格式看起来相同

这是一个jsfiddle 链接,显示我的列表。

这是 HTML:

<fieldset>
<legend>Automobiles:</legend>
<div class="tierGrp gm">
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="2" checked >Spark</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="8" checked >Sonic</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="32" checked >Cruze</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="10" checked >Malibu</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="17" checked >Impala</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="21" checked >SS Sedan</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="13" checked >Camero</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="29" checked >Corvette</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="9" checked >Motorsports</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="30" checked >Trax</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="25" checked >Equinox</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="27" checked >Traverse</label>
    <label class="cars chevrolet" style="display:block"><input type="checkbox" value="28" checked >Tahoe</label>
</div>
</fieldset>

这是 CSS:

.tierGrp {
    align:center;
    text-align:center;
    font-size:26px;
    background-color:#EEE;
    width:625px;
    height:auto;
    display:block;
    margin-bottom: 5px;
    margin-left: auto;
    margin-right: auto;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -khtml-border-radius: 8px;
    border-radius: 8px;
    padding-top: 3px;
    padding-bottom: 3px;
    }
.gm {
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;
    -webkit-column-fill: balance;
    -moz-column-fill: balance;
    column-fill: balance;
    -webkit-column-gap: 5px;
    -moz-column-gap: 5px;
    column-gap: 5px;
    text-align:left;
}
.cars {
    font-size: 18px;
    font-family:Georgia, "Times New Roman", Times, serif;
    font-weight:300;
    border:1px solid #3498DB;
    border-radius:5px;
    background:#EDF5FA 50% 50%;
    height:auto;
    min-width:100px !important;
    padding-left:5px;
    padding-right:5px;
    cursor: pointer;
}

我会为解决格式问题提供任何帮助。

【问题讨论】:

    标签: html css google-chrome


    【解决方案1】:

    Chrome 中似乎有一个已知的错误会导致这样的行为。类似问题请参阅hereherehere

    在你的情况下,这似乎有效:

    .cars {
      -webkit-transform: translate3d(0,0,0);
    }
    

    JSFIDDLE

    【讨论】:

    • 此解决方案解决了 chrome 问题,但不解决 I.E.问题。你知道 I.E. 的修复方法吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-12
    • 1970-01-01
    • 2013-04-14
    • 2019-03-27
    • 1970-01-01
    • 2012-05-24
    相关资源
    最近更新 更多