Unable to eliminate the margin on the right side

I can't seem to get the width of my whole page to stay at 1200px. Every time I set the html or body width to 1200px, Chrome web dev tools shows it as around 1300px with a wide right margin. I've tried adding extra code based on similar posts that helped others, but I still can't figure out what's wrong. Can someone please help me troubleshoot this issue?

html,body
{
    margin: 0px;
    padding: 0px;
    display: inline-block;
    width: 1200px;
}

@font-face {
    font-family: Montserrat-Regular;
    src: url('../fonts/Montserrat-Regular.ttf') format('opentype');
    font-family: Montserrat-Bold;
    src: url('../fonts/Montserrat-Bold.ttf') format('opentype');
}

body{
    font-family: 'Montserrat-Regular', sans-serif;
    margin: 0;
    width: 100%;

}

/*GRID*/

.full-width{
    width: 100%;
    clear: both;
    padding-left: 20px;
}

.half-width{
    width:50%;
    float: left;
}

.third-width{
    width:33%;
    float:left;
}

/*HEADER*/
header{
    border-bottom: 6px #77a466;
}

ul{
    color:#77a466;
    list-style-type: none;
 }

nav{
    float:right;
    padding-top: 25px;
 }

nav ul li{
    display:inline;
    text-transform: uppercase;
    font-family:'Montserrat-Bold', sans serif;
    padding: 0 8px 0 8px;
 }

 h1{
    line-height: 60px;
 }

h1, h2, h3{
    font-family: 'Montserrat-Bold', sans-serif;
    text-transform: uppercase;
}
span{
    color: #77a466;
}

/*MAIN*/
 img{
    background-size: cover;
    height: 290px;
    width: 1200px;

 }

Answer №1

To enhance your CSS, consider incorporating the following code snippet:

* {
     box-sizing: border-box
}
. Additionally, I concur with Lux's suggestion to provide a live example for better assistance in finding a resolution.

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

Strategies for reducing the amount of space between cards in Bootstrap 4

After creating 4 cards using Bootstrap version 4.5, I noticed that the spacing is not right. I'm struggling to reduce the spacing between the cards. Have a look at the image below if you're still confused: https://i.sstatic.net/RrJLL.jpg .car ...

Initiating change upon componentDidMount

Seeking advice on implementing a transition with react and css. The goal is to apply a class to the span element to achieve the desired animation effect – see illustration below. Curious to know whether the issue lies in the css implementation or the ja ...

Adjust the image's height to adapt to the size of the browser

I'm having trouble resizing the images to match the height of the browser window. My goal is to limit the images' height to a maximum of 1100px and have them scale down based on the height of the browser. I've experimented with setting the ...

Unable to watch video on android webview

I'm currently developing a mobile application for Android using PhoneGap, and I'm having trouble with playing HTML5 videos on my web page. The video is not visible and does not play automatically. How can I successfully play a HTML5 video on an A ...

The Bootstrap tabs are not correctly displaying the content

Hey there, I'm currently working on a project that involves using bootstrap tabs (BS4) within a form. One of the requirements is to have forward and back buttons for form navigation, and I'd like to leverage BS4's tab('show') fun ...

Issue with Animation Pause Functionality

I'm currently working on a music loader feature and I'm trying to create a toggle switch to pause and play the music. So far, I've been struggling with this functionality but managed to get it partially working on a simpler project, which yo ...

Handling redirection on a single-page website without javascript functionality turned on

Currently, I am in the process of creating a single-page website using html, css, javascript, and php. My aim is to use jQuery for navigating through the website - allowing the content to fade out when a user clicks on a link in the navigation menu and hav ...

Retrieve the URL and store it | Browser Add-on

I'm looking to create a feature where, upon clicking an icon on my window, it will open and display the URL of the current tab. Next to the URL, I want a "Save" button that will store the link in localStorage and show it below in the saved links area. ...

How to Manage Posts in Laravel with Controllers: Deleting and Updating

{!! Form::open(['action'=>['PostsController@update',$post->id],'method'=>'POST']) !!} <div class="form-group"> {{Form::label('title', 'Title')}} {{Fo ...

What is the best way to make my <div> element expand to fill the entire width of the screen? I attempted setting the width to 100%, but it didn

I need help creating a <div> that spans the entire width of the screen. In my CSS, I have this code: #spacer3 { width:100%; height:300px; } Although it seems like it should work, the div is not extending all the way to the edges of the screen on ...

Navigating without the need for a mouse click

Is there a way to automatically redirect without user interaction? I need the redirection to happen without clicking on anything <script> setInterval(function(){ window.location.replace("http://your.next.page/"); }, 5000); // Redirec ...

When displaying a SELECT tag in Meteor JS with Blaze, remember to apply the class "ian:accounts-ui-bootstrap-3" to the element

Currently, my project is running on Meteor version 1.6.1.1. Instead of using the accounts-ui package, I have opted for ian:accounts-ui-bootstrap-3. As part of customization, I have included a custom field as a <select> element in the code. Here&apos ...

Guide to horizontally centering the main div with a div positioned to its left

Seeking the most effective method to achieve the following layout: --------------------------|-------------------------- | | | -------- ------------------------- | | | menu | | ...

What is the best way to customize the appearance of a non-current month cell within the date picker?

I'm currently in the process of developing a registration form for my JavaFX application. I am faced with an issue where I need to disable certain cells in the date picker when they do not belong to the displayed month. Let's take a look at my cu ...

Error message displayed when attempting to send emails through an HTML form obtained from a complimentary template site

Currently, I am in the process of learning to code basic websites but I'm facing some challenges with getting the contact form to function properly. I decided to work with a free template that can be found at this link: and uploaded it to a shared ho ...

Tips for updating the class of a button upon clicking it

I have a dilemma with my two buttons - one is green and the other has no background. I want them to change appearance when clicked, from green to one with a dashed border-bottom style. Below is the HTML code for these buttons: <div class="btns"> ...

What is the best way to ensure my website page fits the browser window properly?

I'm currently working on my portfolio page for a class project. I want to make sure that the webpage adjusts properly when the browser window is resized, particularly the navigation links in the header section. When the screen is in full view, the nav ...

Issue encountered after updating to version 2.0 of Datatables.net: Conflict between custom CSS and BS5

Having utilized Datatables.net v1.13.11 in conjunction with custom BS5 templates from Themesbrand (), I recently upgraded to v2.0 and came across the following observations: A border box appeared when hovering over a column header. Extra top and bottom bo ...

Utilizing SVG files as React components can alter the CSS inline styling variables

Within my React application, I am bringing in an SVG as a React component in the following manner: import React from "react"; import {ReactComponent as SomeSVGComponent} from "./some_svg.svg"; function SomeComponent(props){ return ...

jquery sequential fade effect

I am trying to make each div fade in one by one. Visit this link for reference <div id="w"> <div class="one"></div> <div class="two"></div> <div class="three"></div> </div> $(function() { $(&a ...