What is causing the unnecessary scroll bars to appear on my website?

I am currently in the process of developing a website for discord servers, aimed at connecting people and helping them find new communities. However, I have encountered an issue where my web page is displaying both horizontal and vertical scroll bars unnecessarily. Here is the HTML and CSS code I am using:

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%;
}

I need assistance in troubleshooting this problem as it is hindering my progress. Any guidance on resolving this issue would be greatly appreciated.

Answer №1

This is the perfect blend

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

When you have a block level box, its margin area ends up being as wide as its container. By moving it 13% from its container's left edge, its right edge will be positioned at 113% of the container's width. This can cause horizontal overflow.

To avoid this, consider using margin-left in place of left.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An element within a form tag called 'section'

Can a <section> be placed inside a <form>? I understand that technically it is possible, as both <section> and <form> are considered "box-model" elements by the W3 standards. However, I am curious if it is considered a proper pract ...

What is the best way to choose a specific div within a container that contains additional HTML elements?

I am facing an issue with selecting the second div tag within a section that contains 2 divs and an img tag. I attempted to use section div:nth-child(2), but it is targeting the second element inside the first div. However, my goal is to select the secon ...

Code for Rotating the Wheel - MINUS javascript

Exploring the possibility of creating a spin the wheel effect like this using only HTML and CSS, no Javascript involved Seeking references or examples to determine feasibility. ...

Is it possible to customize the bullet color for an unordered list using li:before?

Recently, I came across a clever solution for changing the color of a bullet point. The method mentioned an alternative approach as well. "If you're unable to edit your HTML, you can opt for list-style-image with a customized colored dot, or utilize ...

Divide the table columns and place them into their respective individual tables

I am faced with a task to split a table with multiple columns into separate tables for each column. My approach is as follows: Identify th in each column. Use the th tag as an indicator for a new column. Locate tr td in each column. Create a new table ...

Is it possible to extract around 10 variables from a JavaScript code, then display them on a webpage after execution?

I have just completed writing a Javascript code with around 3,000 lines. This code contains over 60 variables, but there are a few specific variables that I would like to display on my main HTML page. These variables include: totalTime longitudinalAcceler ...

What could be the reason for the fluctuating HTML output?

Exploring the world of CSS and HTML, I noticed a curious change in the output when text is added inside a div tag. First: div.bar { display: inline-block; width: 20px; height: 75px; /* We'll override height later */ background-co ...

Struggling to set up a css3 keyframe slide effect and seeking help to properly configure it. Check out the Fiddle for more details

I am looking to create a responsive version of the animation in this fiddle (link provided below). I want the animation to be 100% wide and have a height of 500px. However, when I adjust the width to 100%, it causes issues at the end of the animation. Can ...

Is it possible to apply a click effect to a specific child element of a parent using jQuery?

Struggling to figure out how to modify this jQuery code so that only the parent of the clicked button displays its child. Currently, all children are displayed when any button is clicked, not just the one within the targeted parent. I attempted using $(t ...

Creating a function that uses setInterval to continuously update the input with a specific value

I am looking to use the setInterval function to continuously update the value of #test1. Additionally, I want the value of #test1 to be cleared and reset to 1 second after the user clicks a button. Example output can be found here: http://jsfiddle.net/eK ...

The functionality of ngClass fails to toggle the value appropriately when utilizing an object within a component

When implementing the code below to toggle the class, everything runs smoothly <p [ngClass]="idPresent ? 'alert alert-success' : 'alert alert-danger'"> Working </p> After changing the value of IdPresent in the c ...

Is there a solution to manage Adblocker's blocking of Ajax URLs that contain the term "ad" without having to modify the URL?

The Adblocker is blocking URLs that contain the keyword "advertiser," like: http://localhost/project1/advertiser/users/get_user_listing/ I have numerous URLs and AJAX calls that include this keyword. Is there a way to work around this blocker? Note: Cha ...

What is the best way to populate data with Angular framework in my specific situation?

I'm currently working with Angular and attempting to implement a pagination feature. Here is what I have so far: Angular controller appModule.controller('testCtrl', ['$scope', function ($scope) { $scope.numbers = 7; }]) html ...

Error message: Angular JS function is not defined

I have been diving into AngularJS with the help of video tutorials from AngularJS.org. However, when I try to run my code, an error message pops up: Error: [ng:areq] Argument 'ReviewController' is not a function Even though my code mirrors th ...

Modify the base URL with JavaScript

Is it possible to dynamically change the href using JavaScript? I attempted to make this change with the code below in my HTML file, but unfortunately, it didn't work: <base href="/" /> <script type="text/javascript"> function setbasehr ...

Exploring Vaadin 14 Slider Components

I'm looking for help on how to incorporate a slider into my Vaadin 14 project. I discovered that the slider component was removed in Vaadin 10, so I turned to this alternative: Once I added the Maven dependency and repository to my pom.xml, I success ...

Divs functioning properly on Internet Explorer, but experiencing issues on Chrome

It seems that the styling of my website in Google Chrome is not displaying as expected (link). However, it works fine on Internet Explorer 8. Here is the CSS style sheet: @charset "utf-8"; /* Stylesheet for Northview Game Tickets */ #mainwrapper { w ...

Drag the label into the designated paragraph to copy the text. Click on the specific point to transfer the text

How can I copy the text from a label to a specific point by dragging it? <label id="text_to_be_copied" > i am a student </label> Below is a paragraph where I want to paste the copied text: <p> this is the content where I want to copy t ...

Bootstrap Navigation Bar with No Possibilities for Expansion

I've been struggling to implement collapsible navbar functionality into my existing navbar which includes multiple dropdowns. Despite my efforts, the collapsible feature doesn't seem to work properly. I suspect that it could be due to the presenc ...

Adjust the scroll speed of the mouse

Is there a way to make my ReactJS application scroll to screen height with each mouse scroll? And if not, how can I manually set the scroll step for the mouse? Alternatively, I'm looking for a solution to detect the user's mouse step regardless o ...