我网站的哪一部分太宽了?
Which part of my website makes it too wide?
我遇到了最奇怪的问题...
我遇到了问题,我的网站内容太宽了。我的意思是,我有一个水平滚动条。我真的不知道为什么。我检查了我的 CSS 代码的每一行以及我的 HTML。但是问题依旧。
我希望有人无聊到这里来帮助我...
我将站点上传到 netlify:https://usov.netlify.app/
HTML
<!Doctype HTML>
<html>
<head>
<title>UniqueSurvival</title>
<meta charset="utf-8">
<meta name="viewport" content="width=devicewidth, initial-scale=1.0">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/gallery.css" rel="stylesheet" type="text/css">
<script src="https://kit.fontawesome.com/1908996dcd.js" crossorigin="anonymous"></script>
<link rel="icon" href="">
</head>
<body>
<div id="page-container">
<div id="main-nav">
<nav>
<a href="https://docs.uniquesurvival.net/" target="_blank"><i class="fas fa-book"></i> Wiki</a>
</nav>
</div>
<div id="content-wrap">
<p id="headline">Unique Survival</p>
<div id="content-content">
lorem ipsum dolor sit amet
</div>
</div> <!--schließt content wrap-->
<footer id="footer">
</footer>
</div> <!--schließt page container-->
</body>
</html>
CSS:
@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');
:root{
font-family: "Varela Round";
font-size: 1.1rem;
background: rgba(37, 37, 38);
background-image:
linear-gradient(to bottom, rgba(245, 246, 252, 0), rgba(37, 37, 38)),
url('/pics/bg.jpg');
width: auto;
height: 114.2%;
background-size: cover;
background-repeat: no-repeat;
color: white;
}
div#page-container{
}
div#main-nav{
z-index: 0;
font-family: "Varela Round";
font-size: 1.5rem;
position: relative;
left: 20%;
top: 10px;
}
div#main-nav a{
text-decoration: none;
}
div#main-nav a:link{
transition: 0.5s;
color: rgb(158, 158, 158);
}
div#main-nav a:visited {
transition: 0.5s;
color: rgb(158, 158, 158);
}
div#main-nav a:hover {
transition: 0.5s;
color: rgb(175, 255, 144);
}
div#content-wrap{
width: 60%;
position: relative;
left: 20%;
top: 0;
text-align: justify;
}
p#headline{
position: relative;
top: 0;
text-align: center;
width: 99%;
font-size: 6rem;
letter-spacing: 0.5rem;
background: -webkit-linear-gradient(#ffffff, rgba(66, 66, 66, 0));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
div#content-content{
background-color: rgb(32, 32, 32);
position: relative;
}
删除“位置:相对;”或添加“max-width: 80%;”
div#main-nav {
z-index: 0;
font-family: "Varela Round";
font-size: 1.5rem;
left: 20%;
top: 10px;
}
在 div#main-nav
下添加 max-width: 80%
。
left:20%
将导航栏推出屏幕 20%。
我遇到了最奇怪的问题...
我遇到了问题,我的网站内容太宽了。我的意思是,我有一个水平滚动条。我真的不知道为什么。我检查了我的 CSS 代码的每一行以及我的 HTML。但是问题依旧。
我希望有人无聊到这里来帮助我...
我将站点上传到 netlify:https://usov.netlify.app/
HTML
<!Doctype HTML>
<html>
<head>
<title>UniqueSurvival</title>
<meta charset="utf-8">
<meta name="viewport" content="width=devicewidth, initial-scale=1.0">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/gallery.css" rel="stylesheet" type="text/css">
<script src="https://kit.fontawesome.com/1908996dcd.js" crossorigin="anonymous"></script>
<link rel="icon" href="">
</head>
<body>
<div id="page-container">
<div id="main-nav">
<nav>
<a href="https://docs.uniquesurvival.net/" target="_blank"><i class="fas fa-book"></i> Wiki</a>
</nav>
</div>
<div id="content-wrap">
<p id="headline">Unique Survival</p>
<div id="content-content">
lorem ipsum dolor sit amet
</div>
</div> <!--schließt content wrap-->
<footer id="footer">
</footer>
</div> <!--schließt page container-->
</body>
</html>
CSS:
@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');
:root{
font-family: "Varela Round";
font-size: 1.1rem;
background: rgba(37, 37, 38);
background-image:
linear-gradient(to bottom, rgba(245, 246, 252, 0), rgba(37, 37, 38)),
url('/pics/bg.jpg');
width: auto;
height: 114.2%;
background-size: cover;
background-repeat: no-repeat;
color: white;
}
div#page-container{
}
div#main-nav{
z-index: 0;
font-family: "Varela Round";
font-size: 1.5rem;
position: relative;
left: 20%;
top: 10px;
}
div#main-nav a{
text-decoration: none;
}
div#main-nav a:link{
transition: 0.5s;
color: rgb(158, 158, 158);
}
div#main-nav a:visited {
transition: 0.5s;
color: rgb(158, 158, 158);
}
div#main-nav a:hover {
transition: 0.5s;
color: rgb(175, 255, 144);
}
div#content-wrap{
width: 60%;
position: relative;
left: 20%;
top: 0;
text-align: justify;
}
p#headline{
position: relative;
top: 0;
text-align: center;
width: 99%;
font-size: 6rem;
letter-spacing: 0.5rem;
background: -webkit-linear-gradient(#ffffff, rgba(66, 66, 66, 0));
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
div#content-content{
background-color: rgb(32, 32, 32);
position: relative;
}
删除“位置:相对;”或添加“max-width: 80%;”
div#main-nav {
z-index: 0;
font-family: "Varela Round";
font-size: 1.5rem;
left: 20%;
top: 10px;
}
在 div#main-nav
下添加 max-width: 80%
。
left:20%
将导航栏推出屏幕 20%。