Specifying a zero margin on a Bootstrap container does not remove the margin

I am trying to make my right container elements fill the entire width of their column. After inspecting in Chrome, I noticed that my bootstrap container had default margins on both sides. To fix this, I set the margins to zero.

Although the left margin disappeared as expected, the right margin still persists. Even though the inspector shows a zero margin, there is a visible orange space attached to the container.

You can see the issue in this screenshot

<div class="container-fluid">
<div class="bg-img">
  <div>
    <img class="logo" src="./images/logo.svg" alt="logo">
  </div>
  <div class="container">
    <div class="row no-margin">
      <div class="col-lg-8 left-col">
        <img class="illu-img" src="./images/illustration-mockups.svg" alt="illustration-mockups">
      </div>
      <div class="col-lg-4 right-col">
        <h1>Build The Community Your Fans Will Love</h1>
        <h2>Huddle re-imagines the way we build communities. You have a voice, but so does your audience. 
          Create connections with your users as you engage in genuine discussion. </h2>
      </div>
    </div>
  </div>
</div>
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: hsl(257, 40%, 49%);
    font-family: 'Poppins', sans-serif;
    color: #fff;
    overflow: hidden;
}

h2 {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.2rem;
}

.bg-img {
    height: 100vh;
    background-image: url(./images/bg-desktop.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    padding: 4%; 
}

.logo {
    margin-bottom: 50px;
}

.container {
    margin-left: 0;
    margin-right: 0;
}

.illu-img {
    width: 101%;
}

Answer №1

It seems that your issue stems from the max-width property set for the container class. To resolve this, you can override the max-width property for the container like so:

.container {
  margin-left: 0;
  margin-right: 0;
  max-width: unset;
}

Check out the live demonstration here: codepen.io

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

Difficulty encountered with altering background color of table row in Firefox using CSS

I'm facing an issue with styling table rows that have alternating classes - I want to highlight the row that is being hovered on using CSS. Below is the CSS code I have implemented: .gridrowclass1 { background-color : #bbb00b } .gridrowclass1:h ...

Continuous animation for a sequence of overlapping images with smooth transitions

Currently, I am in the process of developing a JavaScript script that will cycle through a series of images within the same <div>. The goal is to create a seamless animation effect with the image transitions. Although the images are cycling through, ...

Troubleshooting: Inefficient multiple name selection with Jquery

Hey there, I'm currently testing some code for my website that involves selecting multiple names using jQuery. However, I'm encountering an issue where only one of the checkbox groups is working. The goal is to allow users to select only one opt ...

Utilize CSS to create a visual buffer at the bottom of the header

I'm having trouble creating a gap between the bottom of "headermenu" and the top of "list". No matter what values I use for margin-bottom or padding-bottom, the table won't budge. I could try adding margin-top to the table, but I would prefer to ...

Guide on assigning a value to an input field using Vuejs

<div class="col-md-8"> <va-input label="Address 1" v-model="Address1" id="address" class="inp"> </va-input> </div> After calling the API to retrieve data, I need to populate the above input field wit ...

Ensure the website is able to adjust its size when the top banner increases in size

On my website, there is a top banner containing contact information that expands when clicked. However, the expanded div overlaps the site content. Is there a way to make the site scale with the expanded div so that the top of the site starts below it? I ...

Tips for adjusting layout when screen orientation changes (Apache Cordova)

Is there a way to alter the layout of an HTML file when the orientation changes? I've created an app that looks perfect in portrait mode, but when I switch to landscape, it gets messed up because buttons and other elements are shifting down. I don&apo ...

Concealment vs Deletion of DOM components

Conceal or Erase When dealing with changing DOM elements, is it better to hide them or delete them? Consider that the environment may change frequently and that elements can have various event callbacks. Hide: What is the best approach when hiding eleme ...

Troubleshooting HTML navigation bar white space problem

I am encountering a white space issue with my HTML nav bar for the first time. I have managed to fix the space on the sides (left and right), but there is still some space at the top of the nav bar. Can someone please assist me in resolving this issue? To ...

Centered Layout using HTML and CSS

Exploring the world of Ruby on Rails and HTML has been quite an adventure. Today's question veers away from RoR and focuses on HTML and CSS. As I attempt to center my body, a peculiar issue arises: Help me solve this problem here How can I align the ...

Challenges with locating text within the innerHtml property of a VB WebBrowser Object

Using Visual Studio 2010 with Visual Basic.NET In my project, I have created a form that utilizes a WebBrowser control to load an HTML file. Users are able to search for specific words or phrases within the document, prompting me to extract the innerHtml ...

Is the PHP Ajax parameter missing during the upload process?

I'm attempting to do a simple upload, but I seem to be struggling. It could be that I'm not understanding it properly, or perhaps it's just too late at night for me to figure it out. After doing some research, I came across this example on ...

Is it possible to activate numerous hover effects on links by hovering over a div?

How can I trigger multiple hover effects simultaneously when hovering over my main div? I'm struggling to figure out how to make the line animate on all three links at the same time. Is it possible to achieve this using only CSS or do I need to use Ja ...

Calls to the function are piling up

There is a bootstrap modal that displays a confirmation message. If the 'accept' button is clicked, a function is called with an id. If the 'cancel' or 'close' button is clicked, the modal closes. The problem arises when the m ...

Having trouble embedding Hangouts button in HTML template using script tags

When I include a Hangouts button on my index page, it is visible and functional as expected: <body ng-app="sampleApp" ng-controller="MainCtrl"> <div class="row"> <div class="col-md-12 m-body"> <div class="m ...

Tips for creating a highly adaptable code base- Utilize variables

Can anyone help me optimize this lengthy and cumbersome code in HTML and JS? I want to make it more efficient by using variables instead of repeating the same code over and over. In the HTML, I've used href links to switch between different months, w ...

Coldfusion: The Troubles of an Empty Link href="#" Error

For my CFWheels Coldfusion project, I have been utilizing Adobe Coldfusion Builder 3. In Coldfusion, when you want to output a variable, you typically do something like this: #variable_name# However, I am interested in incorporating an empty link into m ...

Accessing an image with a URL in AngularJS

Update: Just learned that specifying the url in the scope is unnecessary. I also appreciate the reminder to be cautious with the key, thank you. I'm attempting to display images and their corresponding names in an HTML5 document. Here's a snippe ...

Issue with Bootstrap flash alert CSS on mobile devices is not functioning properly

I am in the process of developing a Rails application. Within my app, I utilize Bootstrap's CSS for displaying flash messages on alerts. Instead of fully incorporating Bootstrap's CSS, I only integrate styles related to alerts in order to prevent ...

Steps to avoid HTML encoding the ' character in Next.js _document.js file

Currently, I am working on integrating VWO into my website by following the steps mentioned here. I have included the VWO script tag within a NextJs Head tag as shown below: <Head> <script type='text/javascript' id='vwoC ...