css - 车身无余量

标签 css

我的 body 有 8px 的边距,但在我的 css 中我有:

body {    
    margin: 0 !important;
    padding: 0 !important;
}

为什么不遵守样式? CSS 文件加载正确,我已经检查过了。

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="/styles.css" />
    </head>
    <body id="page-name">
        <div id="drag-overlay"></div>
        <h1>Title</h1>
    </body>
</html>

最佳答案

你试过吗

html, body {    
     margin: 0 !important;
     padding: 0 !important;
}

关于css - 车身无余量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23805642/

相关文章:

css - 如何获取相对于浏览器窗口右侧的光标位置

html - 复合组件和 CSS

html - Wired 杂志是如何实现这种粗下划线链接效果的?

javascript - 将修饰符类应用于数组中的指定元素[React]

html - 当悬停 p 元素时尝试显示 div 元素时,我的 CSS 无法正常工作

css - 在 CSS 中使用非常具体的选择器有优势吗?

css - 网站的风格取决于季节

html - Google map 和 Contact Form 7 对齐

html - 在已受页面级页眉和页脚限制的内容中添加固定页脚

css - svg 伪背景图像文件未在实时站点上显示但在本地主机上工作为什么?