如何修复页面顶部的空白?
How do i fix the gap at the top of the page?
我正在尝试将灰色框移至页面顶部。
如有任何代码片段,我们将不胜感激。
<style> * { font-family: "arial" }</style>
<h1 class="small" style="background-attachment: scroll; background-clip: border-box; background-color: rgb(229, 229, 229); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: rgb(229, 229, 229); font-family: inherit; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 600; letter-spacing: normal; line-height: 1.1; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 15px; padding-left: 10px; padding-right: 10px; padding-top: 15px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"></h1><span style="display: inline !important; float: none; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">
</span><div class="field" style="background-attachment: scroll; background-clip: border-box; background-color: rgb(229, 229, 229); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: rgb(229, 229, 229); border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: rgb(229, 229, 229); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(229, 229, 229); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(229, 229, 229); border-top-style: solid; border-top-width: 1px; box-sizing: border-box; color: rgb(255, 255, 255); font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; orphans: 2; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br></div
尝试将样式 margin-top:0 添加到 body 和 h1 标签
您的浏览器 User-Agent 添加浏览器特定样式。
您需要在 <style>
标记或外部样式表中覆盖它们。
因此,要解决您的问题,您需要添加以下代码;
body { margin: 0; }
h1 { margin-top: 0; }
我正在尝试将灰色框移至页面顶部。
如有任何代码片段,我们将不胜感激。
<style> * { font-family: "arial" }</style>
<h1 class="small" style="background-attachment: scroll; background-clip: border-box; background-color: rgb(229, 229, 229); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; box-sizing: border-box; color: rgb(229, 229, 229); font-family: inherit; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 600; letter-spacing: normal; line-height: 1.1; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-bottom: 15px; padding-left: 10px; padding-right: 10px; padding-top: 15px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"></h1><span style="display: inline !important; float: none; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">
</span><div class="field" style="background-attachment: scroll; background-clip: border-box; background-color: rgb(229, 229, 229); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-color: rgb(229, 229, 229); border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; border-left-color: rgb(229, 229, 229); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(229, 229, 229); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(229, 229, 229); border-top-style: solid; border-top-width: 1px; box-sizing: border-box; color: rgb(255, 255, 255); font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; orphans: 2; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><br></div
尝试将样式 margin-top:0 添加到 body 和 h1 标签
您的浏览器 User-Agent 添加浏览器特定样式。
您需要在 <style>
标记或外部样式表中覆盖它们。
因此,要解决您的问题,您需要添加以下代码;
body { margin: 0; }
h1 { margin-top: 0; }