【问题标题】:How to hide a gap between IE 10 html & body (x-scrollbar space?)如何隐藏 IE 10 html & body(x-滚动条空间?)
【发布时间】:2015-03-22 22:56:47
【问题描述】:

我发现 IE 10 在 html 和 body 标签之间有一个间隙, 我尝试使用 CSS padding:0, margin:0 和 overscroll-x: hidden 但它仍然不起作用,有没有人找到解决方案?谢谢!

示例链接如下: enter link description here

html, body {
  overflow-x: hidden;
  padding: 0;
  margin: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
    <div style="background-color: pink; width: 500px; height: 1500px;">
        1234
    </div>

</body>
</html>

【问题讨论】:

    标签: html css internet-explorer internet-explorer-10


    【解决方案1】:

    将此 CSS 重置添加到您的所有项目中:

    重置样式表的目标是减少浏览器在默认行高、页边距和标题字体大小等方面的不一致。

    /* http://meyerweb.com/eric/tools/css/reset/ 
       v2.0 | 20110126
       License: none (public domain)
    */
    
    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td,
    article, aside, canvas, details, embed, 
    figure, figcaption, footer, header, hgroup, 
    menu, nav, output, ruby, section, summary,
    time, mark, audio, video {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 100%;
        font: inherit;
        vertical-align: baseline;
    }
    /* HTML5 display-role reset for older browsers */
    article, aside, details, figcaption, figure, 
    footer, header, hgroup, menu, nav, section {
        display: block;
    }
    body {
        line-height: 1;
    }
    ol, ul {
        list-style: none;
    }
    blockquote, q {
        quotes: none;
    }
    blockquote:before, blockquote:after,
    q:before, q:after {
        content: '';
        content: none;
    }
    table {
        border-collapse: collapse;
        border-spacing: 0;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-05
      • 2017-02-18
      • 2021-02-27
      • 2018-08-17
      • 1970-01-01
      • 2016-06-06
      • 2014-04-23
      • 2023-03-14
      相关资源
      最近更新 更多