为什么我的网站上有不应该有的滚动条?

Why do I have scroll bars on my website when there shouldn't be?

我正在制作一个 discord 服务器网站,供人们找到 discord 服务器加入并结交朋友,但是,我不知道为什么我的网页有水平滚动条。 它还有一个垂直滚动条,但现在还没有 这是我的 HTML 和 CSS

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>OnTop Servers</title>
</head>
<body>
    <nav class="topnav">
        <div class="topnav-right">
        <a class="active" href="index.html">Home</a>
        <a href="search.html">Search</a>
        <a href="servers.html">Servers</a>
        </div>
         <h2 class="title">
            OnTop Servers
        </h2>
    </nav>
    <center>
        <div class="welcome">
            <div class="centered-text">
                <div class="welcome-body-inner">
                <h2 class="head">
                    DISCOVER
                    <span class="discord-logo">DISCORD</span>
                    SERVERS
                </h2>
                <h3 class="body">
                    Find amazing servers to interact with and make friends
                </h3>
                </div>
            </div>
        </div>
    </center>

    <footer>
        <div class="container">
            <div class="column">
                <ul class="footer-links">
                    <li>
                        <a class="link-text" href="index.html" title="Home">
                            Home </a>
                    </li>
                    <li>
                        <a class="link-text" href="search.html" title="Search"> 
                            Search </a>
                    </li>
                    <li>
                        <a class="link-text" href="servers.html" title="Servers"> 
                            Servers </a>
                    </li>
                    <li>
                        <a class="link-text" href="https://discord.gg/" target="_blank">
                            Official Discord Server </a>
                    </li>
                    <li>
                        <a class="link-text" href="termsofservice.html" target="_blank">
                            Terms Of Service </a>
                    </li>
                    <li>
                        <a class="link-text" href="guidelines.html" target="_blank">
                            Guidelines </a>
                    </li>
                </ul>
            </div>   
        </div>
        <div class="copyright"> 
            <p class="copyright-text">&copy; Copyright 2020 OnTop Servers</p>
            </div>
        </footer>
</body>
</html>

CSS:

  .row::after {
    clear: both;
    display: table;
  }

.copyright {
    position: absolute;
    bottom: 1%;
    right: 1%;
    font-size: 15px;
}

.copyright-text {
  color: white;
}

.footer-links {
  position: absolute;
  bottom: 5%;
}

.link-text {
  color: white;
  text-decoration: none;
}

.container {
  padding: 0;
  margin: 0;
}

li {
  list-style-type: none;
}

footer {
  position: absolute;
  bottom: 0%;
  clear: both;
  height: 200px;
  width: 1920px;
  color: #fff;
  background: #2c2c2c;
}

.welcome {
  margin-top: -2.5rem;
  width: 100%;
  height: 35.5rem;
  line-height: 1.8em;
  margin-bottom: .4em;
  padding: 0;
  font-family: Helvetica;
  font-weight: 600;
  font-size: 1.5em;
  color: #ffff;
  text-transform: uppercase;
}

.centered-text {
  position: relative;
  left: 24.5%;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.discord-logo {
  border: 0;
  font: 0/0 a;
  text-shadow: none;
  color: transparent;
  display: inline-block;
  padding: .6em 0;
  background: url(images/Discord-Wordmark-White.png) center no-repeat;
  background-size: contain;
  font-size: 1em;
}

.head {
  margin-bottom: .4em;
  padding: 0;
  line-height: 1.4;
  font-weight: 600;
  font-size: 2em;
}

.body {
  margin: 0 auto 1em;
  text-transform: inherit;
  opacity: 85%;
}

我该如何解决这个问题,这个问题真的很困扰我,我无法弄清楚问题出在哪里?

就是这个组合

position: relative;
left: 24.5%;
display: flex;

你有一个块级框,它的边距区域因此与其容器一样宽,然后它向右移动其容器宽度的 24.5%,使其右边缘距容器左侧 124.5%边缘。这总是会水平溢出容器。

我建议使用 margin-left 而不是 left