Removing margins in Bootstrap 5: A step-by-step guide

Currently facing an issue with removing margins in bootstrap. I am looking to set up two graphics that indicate the under construction status of the page - one for desktop and one for mobile devices.

This is what I have tried so far:

<!DOCTYPE html>
<html lang="pl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2bdb6b6ad9e90909184899cb7afb7afc2">[email protected]</a>/dist/css/bootstrap.min.css">
    <style>
        body,
        html {
            margin: 0;
            padding: 0;
        }

        .full-width-img-container {
            margin: 0;
            padding: 0;
        }

        .full-width-img-container .row {
            margin: 0;
            padding: 0;
        }

        .full-width-img {
            width: 100%;
        }

        @media (min-width: 992px) {
            .full-width-img {
                width: 100vw;
            }
        }
    </style>
    <title>Under Construction Page</title>
</head>
<body>
<div class="container-fluid full-width-img-container">
    <div class="row">
        <div class="col">
            <img src="img/small.jpg" class="img-fluid d-block d-lg-none full-width-img" alt="small graphic">
            <img src="img/big.jpg" class="img-fluid d-none d-lg-block full-width-img" alt="big graphic">
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3e5151504b68667061704526525d525d5c">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

By the way, any recommendations on the ideal graphic sizes for desktop and mobile screens?

Answer №1

Great news! The issue has been resolved. I forgot to assign a value to the .col element.

    .full-width-img-container,
.full-width-img-container .row,
.full-width-img-container .col {
  margin: 0;
  padding: 0;
}

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

Unable to get CSS to function properly on website

I am having trouble getting my text to format properly on my web page. I have defined rules in my style sheet to center an object on the screen, but it's not working as expected. Here is the code for my web page: body { text-align: center; } h1 { ...

Modify the Embed Audio Player in Google Drive

I am looking to integrate audio files from Google Drive into my website. While I have successfully embedded them, the issue lies in not being able to customize the player (as shown in the image below). Is there a way to modify the player? <iframe ...

Turn off the extra space inserted by DataTables

Help needed with centering table header text. <table class="table table-bordered table-hover center-all" id="dataTable"> <thead> <tr> <th scope="col" style="text-align: center">Nam ...

Removing a function when changing screen size, specifically for responsive menus

$(document).ready(function () { // retrieve the width of the screen var screenWidth = 0; $(window).resize(function () { screenWidth = $(document).width(); // if the document's width is less than 768 pixels ...

Unable to alter the background color in a table row when a condition is verified

Within my 'work' array that is generated from an Excel file, I have values for employee_id (referred to as id), projects, and hours. Additionally, I have another array called 'employees' which contains all the employees in my database. ...

Chrome page loading with smooth color transitions

Setting global colors on links and transitions on their color: a { color: blue; transition: color 300ms linear; } Later in the code, there's more specific styling for links in the navigation: nav a { color: red; } nav a:hover { color: black; } ...

Changing the animation associated with a hover action - tips and tricks!

My navigation header includes links to various websites, some of which are displayed as drop-down menus. I have implemented an animation and style change on hover to visually indicate the active link and display all available options in case of a dropdown ...

Adjusting the Image Width in React to Match Bootstrap Column Width

Exploring the capabilities of the react-image-mapper library, I stumbled upon an interesting feature: the ImageMapper component offers a prop called width, representing the image width in pixels. Integrating this component into my application based on the ...

Navbar brand in Bootstrap 4 not centered when navbar is collapsed

I am currently working on aligning the brand-item and nav-items on mobile view. The alignment is incorrect in the mobile view. It is not centered. The "Brand" should be vertically aligned with "link1-3". In the desktop view, the alignment should be like ...

Styling group headers within an unordered list using pure CSS - possible?

Hey there, I'm looking to spruce up my UL by adding group headers. Here's a sneak peek at the structure I have in mind (keep in mind this is generated dynamically from a database): <ul> <li class='group group-1'> < ...

Why does "height: auto;" not function properly when I implement "float:left"?

I have set up three responsive columns and now I want to add a wrapping div for them. Although I have created the wrap div, it seems to only work with pixel values. I would prefer to use percentages or auto as I am aiming for a responsive layout. For exa ...

Child element casting shadow over parent element

I am currently using box shadow for both the parent (.map) and child (.toggle-button): .map { position: fixed; top: 20px; right: 0; width: 280px; height: 280px; z-index: 9999; box-shadow: 0px 1px 6px 0px rgba(0,0,0,0.3); } .map ...

problem with the video pathway in the javascript document

I'm currently in the process of putting together a Video gallery playlist using HTML, CSS, and JavaScript. So far, I've set up the html and css files along with two js files. The first js file contains all the video information as shown here: ...

Displaying the user's username upon logging into a website is a simple yet effective

I have successfully developed a simple web page using PHP and HTML. However, I am facing an issue in displaying the username after login. Additionally, I would like to hide the login and signup sections after successful login. Can anyone provide assistance ...

Properly spaced website images

I'm trying to display my images side by side with a slight margin in between them. However, when I apply a `margin-right: 10px;` to each div, the last image doesn't line up properly with my title bar. Is there a way to create spacing between the ...

The has-error class cannot be applied to certain input elements

I am currently in the process of validating some inputs within a modal: <div id="modal-section" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="m ...

Retrieve the stylesheet based on the presence of a specific class

Is there a way to dynamically add a CSS stylesheet based on the presence of a specific class on a page? For example, instead of checking the time and loading different stylesheets, I want to load different stylesheets depending on the class present in the ...

Is there a way to display the title attribute when truncating a lengthy text in Vue?

Recently, I encountered an issue with my dynamically created table. I added the class truncate to the spans within the td elements to shorten the log sentences and implemented a title attribute to display the full sentence on hover. However, I noticed that ...

Using CSS3 to target the final <li> element within the main list in a nested <ul> structure

I have a complex list structure: <ul> <li>Item</li> <li>Item</li> <li>Item</li> <li> <ul> <li>Nested Item</li> <li>Nested Item</li> <li>L ...

Header displayed on each page. (WordPress)

(my website: ) I am using Wordpress.org and I am trying to create a button that will redirect the user back to the front page, but I am having trouble figuring out how to do it. The button should be located in the top left corner of the site and should not ...