谁能帮我弄清楚这个 css 有什么问题?它不会在任何浏览器中加载。前几天它正在加载,我不知道我最近 super 改变了什么来摧毁它。现在显然堆栈溢出要我在发布之前添加更多详细信息,我不知道还能做什么大声笑。编辑:现在我原来的问题已经解决了,但是出现了一个新问题,现在我的页面的高度和宽度上有额外的空间,现在看来是一个 HTML 问题。编辑:现在看来问题出在所有 .Text 类的 CSS 中。
body {
background: url(http://i.imgur.com/EpgMwgC.jpg) no-repeat center center fixed;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
margin: 0;
padding: 0;
height: auto;
max-width: 900px;
}
/*http://i.imgur.com/p7f9wMQ.jpg*/
hr {
position: relative;
width: 500px;
left: 257px;
bottom: -20px;
display: block;
border-color: #666;
}
div {
width: 100%;
height: 100%;
min-width: 1000px;
min-height: 1000px;
margin: 0 auto;
}
.ProvidenceTxt {
position: relative;
top: 100px;
left: 490px;
}
.ReformedTxt {
position: relative;
top: -10px;
left: 756px;
}
.ChurchTxt {
position: relative;
top: -40px;
left: 550px;
}
.BoiseTxt {
position: relative;
top: -150px;
left: 758px;
}
#YoutubeImg {
position: relative;
width: 150px;
top: -110px;
left: 550px;
}
#FacebookImg {
position: relative;
width: 73px;
top: -134px;
left: 610px;
}
.YoutubeVidBoi {
position: relative;
left: 430px;
top: -10px;
}
HTML:
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="main.css" charset="utf-8">
<link rel="stylesheet" href="textstyle.css" type="text/css" charset="utf-8" />
<meta http-equiv="refresh" content="4">
<head>
<!-- The Title and Favicon of the Website -->
<title>Providence</title>
<link rel="shortcut icon" href="PRCfavicon.ico" type="image/x-icon">
</head>
<body>
<h1 class="ProvidenceTxt">Providence</h1>
<h1 class="ReformedTxt">Reformed</h1>
<h1 class="ChurchTxt">Church</h1>
<h1 class="BoiseTxt">Boise</h1>
<hr>
<a href="https://www.youtube.com/channel/UCZAf3EhGuasVIxucTHB9V0A"><img id=YoutubeImg src="https://www.youtube.com/yt/brand/media/image/YouTube-logo-full_color.png" alt="Youtube Channel"> </a>
<img id=FacebookImg src="https://img.clipartfest.com/c55c67101fd407bcce47c5ed59bf879e_facebook-announces-clickable-facebook-logo_530-300.png" alt="Facebook Page">
</body>
<br>
<iframe class="YoutubeVidBoi" width="560" height="315" src="https://www.youtube.com/embed/bMdIX1mH6r8" frameborder="0" allowfullscreen></iframe>
<footer>
</footer>
</html>
最佳答案
我能看到的唯一问题是您缺少几个分号:
- div 元素选择器中“width: 100%”后缺少分号。
- 在 hr 元素选择器中“border-color: #666”后缺少一个分号(我看到 @danjbh 在评论中已经提到了这个分号)。
我看不到任何其他问题,所以希望这会解决它:)
关于html - 我的 CSS/HTML 有一个明显的重大缺陷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44248545/