My navigation bar's CSS code falls short of extending across the full width of my screen, leaving a gap of approximately 10 pixels before reaching the edges

Can someone help me figure out what went wrong? I've been trying to remove the margins but it's not working. The background colors of other elements seem to be seeping into this empty space. Any thoughts or suggestions would be greatly appreciated.

@font-face {
  src:url(fonts/Staatliches-Regular.ttf);
  font-family: rust;
}
  *{
    margin-top: 0px;
    margin-bottom: 0px;
    font-size: 30px;
    text-align: center;
    font-family: rust;
  }

  body{
      background-color: #6588AB;
  }

  #sad{
    font-style: italic;
  }

  nav{

    margin-top: 0px;
    margin-bottom: 0px;
    width: 100%;
    height: 100px;
    background-color: #fff;
  }

  ul{
    margin: 0;
  padding: 0;
  }

  ul li{
    display: block;
    list-style: none;
    display: inline;
    line-height: 100px;
  }

  ul li a{
    text-decoration: none;
    color: #1e1e1e;
    background-color: #fff;
    padding: 30px 100px 30px 100px;
  }

  ul li a:hover{
    color: red;
  }
<!DOCTYPE html>
<html>
<head>
<title>hello world</title>
<meta charset="UTF-8">
<link  rel="stylesheet">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <nav id = "link">
        <ul>
            <li><a href="pain.html" target="_blank">about me</a></li>
            <li><a href="https://www.youtube.com/watch?v=p_9e0_Fdaek" target="_blank">what i do</a></li>
            <li><a href="https://www.youtube.com/watch?v=X1u-9YqrIJc" target="_blank">why i'm based</a></li>
            <li><a href="https://www.youtube.com/watch?v=7w9hK8mh9-g" target="_blank">contact me</a></li>
        </ul>
    </nav>
    <h1 class = "pog">hello!!!</h1>
    <h2 class = "pog" id ="sadge" title="pog u">pog</h2>
</body>
</html>

Answer №1

Typically, the body tag comes with margins on its sides, which could be causing the issue in your specific situation.

body: {
    margin: 0;
}

If you prefer not to completely remove all styles, you can utilize normalize.css to reset these default styles. Check out the normalize.css GitHub repository for more information.

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

unwelcome tab spacing in CSS

I am facing an issue with unwanted spacing in my lists. I have a code that generates three-column lists, each containing about eight rows. However, the first list item of the last row is causing an unwanted space. It seems to shift entirely to the next col ...

"JavaScript that doesn't rely on a specific browser

Why does this code behave differently across browsers? What modifications are needed to ensure consistent behavior in all of them? In Firefox, it functions correctly, using the URL /some/path/?searchedText=sometext. However, in IE, nothing happens when cli ...

Link the same CSS file with multiple HTML pages

Currently, I am in the process of creating an external CSS file specifically for my homepage. The only issue I am encountering is that while I know how to resolve this problem for one HTML page, I am uncertain about how to address it for other pages. For ...

Code snippet for replacing text enclosed between two tags using regex in PHP programming language

While I am not an expert in regex, I am attempting to develop a code inspired by examples I have come across. My goal is to replace instances of the string <li> with <li class="ingredient"> within a WordPress table. However, this replacement mu ...

Is it possible to create .html files using the provided list of words?

Can we create .html files from a word list? Check out the example shown in the attached image. Thank you! View Image ...

Customize your Google Translate experience by choosing your own option values

Is there a way to trigger the same JavaScript calls by clicking on an option value in an HTML select element as with text-based links in the Google Translate widget? Check out this jsfiddle for more information <html> <body> <select i ...

HTML5 allows users to choose data from a list using a ComboBox and submit the 3-digit code

I'm looking to enhance my form by including an input box where users can select airports, similar to the functionality on this website (). When typing in the Destination Input, I want users to see a list of possible values with detailed suggestions su ...

Enter the Kannada language into the HTML text box or input field

My html form consists of about 15 - 20 input and textarea fields. As a user, how can I enter information in Kannda or any other local language? https://i.stack.imgur.com/60PVT.png ...

The Disabled element does not exhibit effective styling

When we include the disabled attribute in the text element, the style does not work. Can you explain why? <input pInputText [style]="{'padding-bottom':'10px','padding-top':'10px','width':'100%&apos ...

A guide to loading CSS and JavaScript files asynchronously

Is it possible to use loadCSS (https://github.com/filamentgroup/loadCSS/blob/master/README.md) to allow the browser to asynchronously load CSS and JavaScript? This is what I currently have in my head tag: <link rel="preload" href="http://zoidstudios. ...

Issues with Laravel 5.8 and Bootstrap not functioning properly in Jquery

Check out this link for using Bootstrap Select. The code works perfectly in the view, but when I try to implement it with jQuery below, it doesn't work. Can someone help me fix this issue? View Code: <table id="tableAppointment" style=&q ...

Extend and retract within a row of a table

I need help with modifying a dynamically generated table to meet specific requirements. The table currently looks like this. The task involves hiding all columns related to Category B, eliminating duplicate rows for Category A, and displaying entries from ...

utilizing the data provided by a user in the "prompt" window within my HTML code

Looking to utilize user input from the prompt window. This is my custom JavaScript form: var answer; function load() { answer=prompt("what is your name?", "Write your name here"); return answer; } function hideNsee() { var HNS = docume ...

Trouble displaying images from JSON file in AngularJS using ng-src - need help with image loading

While utilizing AngularJS to extract image data from a JSON file, everything seems to work fine for other types of data except images. Why is the ng-src not retrieving any images? I am attempting to load all the images into the div and set the src, alt, a ...

Checking for empty inputs using Html, JavaScript, and CSS

I need help with a form that has 6 input fields. I want to ensure all fields are filled out, and if not, display an alert message. Any suggestions on how to achieve this? Additionally, I'm experiencing difficulties implementing different font styles. ...

Using an array of objects to set a background image in a Bootstrap carousel using jQuery: a step-by-step guide

I have an array of items, each containing a background property with a URL to an image. Here is my array: Here is the HTML structure: <div id="myCarousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators">&l ...

The alignment of images loop and videos loop is off

https://i.stack.imgur.com/6o38F.jpg I am facing an issue with a td container in which I am using PHP to loop through a collection of videos and images. Strangely, the videos are displaying higher than the images even though they are both contained within ...

Specify the database to be created using the select option tag

When utilizing the html form action attribute = "uploadone.php", a form is created with an option element value attribute = 'Red'. This method is used to create multiple databases in this manner. However, adding parameters to the URL becomes cumb ...

"Seamless responsiveness in design with jQuery, but encountering compatibility issues

My usage of jQuery is quite basic to ensure that elements are properly positioned when they are moved: function ipad() { var width = jQuery(window).width(); if (width < 1200 && width >= 768){ //if tablet jQuery('.mobbut').css(&apo ...

Is there a way to update a portion of a webpage to show different content after a form is successfully submitted?

I have implemented a newsletter subscription form on my web app, utilizing Mailchimp to manage the list of subscribers. The process is running smoothly with the Mailchimp API seamlessly adding subscribers from my site to the audience list on Mailchimp. Th ...