gpt4 book ai didi

正在应用 Html CSS 重置,但未兑现

转载 作者:太空宇宙 更新时间:2023-11-03 23:41:02 25 4
gpt4 key购买 nike

所以这很奇怪,即使我应用了标准 CSS 重置,我的页面顶部仍然有很小的边距。如果我在 Chrome/Firefox/甚至 gasp IE 中打开检查器,我会看到主体正在读取我的 margin:0 重置,但无论如何仍然会增加一个间隙。

差距:enter image description here

显示 margin:0 的 Chrome Web Inspector 正在接受: enter image description here

所以,这里 super 奇怪的部分是,如果抛出一个重要的像 margin: 0 !important; ,差距就会消失。我已经多次使用这个精确的模板设置,没有任何问题。希望有人能看到我现在正在躲避的东西。

HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link href="/Content/css/Reset.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap-theme.css" rel="stylesheet"/>
<link href="/Content/css/bootstrap.css" rel="stylesheet"/>
<link href="/Content/css/Site.css" rel="stylesheet"/>

<script src="/Scripts/modernizr-2.6.2.js"></script>
<script src="/Scripts/jquery-1.9.0.js"></script>



<link href='//fonts.googleapis.com/css?family=Ubuntu:300,400,500' rel='stylesheet' type='text/css'>
<script type="text/javascript">var base_url = 'http://localhost:64789/';</script>

</head>
<body>
<div id="wrap">
<h2>Index</h2>
</div>
</body>
</html>

CSS注意:此时 Site.css 是一个空文件,因为我刚刚开始这个元素。

html,body,p,div,img,h1,h2,h3,h4,li,ul,ol,dl,dd,dt,form {
margin:0;
padding:0;
border:0;
border-collapse:separate;
border-spacing:0;
}

a {
text-decoration: none;
}

* {
font-family: 'Ubuntu', sans-serif;
}

body {
background: #f0f6e8 url(../images/gradbackground.jpg) repeat-x 0 top;
}

#wrap {
width: 100%;
background: transparent url(../images/leaves.jpg) no-repeat center top;
}

最佳答案

页边距在 <h2> 上, 而不是 <body> . h2 必须有一些其他选择器那就是增加额外的上边距。在你自己的Site.css样式,包括 margin-top: 0对于 h2

关于正在应用 Html CSS 重置,但未兑现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22869655/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com