How to increase the margin of container fluid without destroying responsiveness


username

I want to add some margin to the container fluid, but when I do that, I get horizontal scrollbars and the grid is broken. How to do this without other side effects?

<div class="container-fluid">
    <div class="row">
      <div class="col-md-3 d-flex align-items-center justify-content-center">
        <mat-form-field class="choose-appointment-date" appearance="fill">
          <mat-label>Choose an appointment date</mat-label>
          <input matInput [matDatepicker]="picker" [min]="minDate" (dateChange)="getSelectedDate($event)"
            class="form-control" [formControl]="appointment_date" disabled>
          <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
          <mat-datepicker touchUi #picker disabled="false"></mat-datepicker>
        </mat-form-field>
      </div>
  
      <div class="col-md-9" *ngIf='availavable_appointment_hours_test'>
        <h3 *ngIf='availavable_appointment_hours_test.length'>Availavable termins for: {{ selected_appointment_date }}
        </h3>
        <h3 *ngIf='!availavable_appointment_hours_test.length' class='red'>There are not availvable dates for:
          {{ selected_appointment_date }}</h3>
        <div class="row">
          <div class="card col-lg-2 make-appointment-card" *ngFor="let hour of availavable_appointment_hours_test">
            <div class="card-body" (click)="selectAppointmentHour(hour)">
              <div class='text-center'>{{ hour.value }} </div>
            </div>
          </div>
        </div>
      </div>
    </div>

</div>
.container-fluid {
margin: 50px !important;
}
Arleigh Hix

Set .container-fluidit to 100%width (same width as the window) and add a fixed margin pxto it (not responsive), so your page is always 100px wider than the window.

You need to use responsive margins for left and right, and set a small responsive width.
Please try one of the following examples:

.container-fluid {
  margin: 50px 10% !important;
  width: 80%;
}

.container-fluid {
  margin: 50px auto !important;
  width: 92%;
}

Related


How to increase margins without breaking responsiveness

rose flower So I have three cards in a row, but they all stick together with no margins and look ugly. I wanted some headroom between each card, so I added it, but it broke the responsiveness the bootloader provided. So I just added padding. Any help would be

How to increase margins without breaking responsiveness

rose flower So I have three cards in a row, but they all stick together with no margins and look ugly. I wanted some headroom between each card, so I added it, but it broke the responsiveness the bootloader provided. So I just added padding. Any help would be

Bootstrap 4 container fluid extra margin

Pierre I am using Bootstrap 4.2 to write a page in html. I would like to have a horizontal navbar at the top of the page that takes the full width of the page and remains static during navigation. I am trying to use some divs in the class "container-fluid". Th

Bootstrap 4 container fluid extra margin

Pierre I am using Bootstrap 4.2 to write a page in html. I would like to have a horizontal navbar at the top of the page that takes the full width of the page and remains static during navigation. I am trying to use some divs in the class "container-fluid". Th

Fluid CSS container without spaces

Thomas Incorrect: correct: How to do this (without spaces between elements)? They must also be centered. HTML: <div class="header container"> <div class="col col-1"> <input type="text" class="text small" name="search" placeholder="Search suppliers"

Fluid CSS container without spaces

Thomas Incorrect: correct: How to do this (without spaces between elements)? They must also be centered. HTML: <div class="header container"> <div class="col col-1"> <input type="text" class="text small" name="search" placeholder="Search suppliers"

How to increase font top margin?

Bjorn C 我正在尝试删除添加到字体顶部/底部的边距。 <div id="wrapper"> <span id="text">Text</span> </div> #wrapper{ width: 200px; height: 200px; Border: 1px solid black; margin: 0px; padding: 0px; } #text{ background: red; font-size: 40px; line-height: 30px; pa

How to increase margin on table row

Meng Sheng I want to add spaces between the rows of the table as shown in the image below: Please show me your code if possible. Partho63 You can use border-spacing. Here is a simple example. table, th, td { background: #ffffff; padding: 5px; } table { b

How to increase margin on table row

Meng Sheng I want to add spaces between the rows of the table as shown in the image below: Please show me your code if possible. Partho63 You can use border-spacing. Here is a simple example. table, th, td { background: #ffffff; padding: 5px; } table { b

How to pause @RabbitListener without destroying AnonymousQueue

KeTr: I have a Spring Boot application that is normally message driven, but needs to stop incoming messages in special cases. However, I can't loose these messages, I need to buffer them and then receive them in the correct order. There are countless questions

How to handle a stream of bytes without destroying the data

rabbit I have a problem with how to handle byte data without corrupting them. this is my code ... byte[] b = new byte[1000]; // read input stream BufferedInputStream inData = new BufferedInputStream(socket.getInputStream()); int length = inData.read(b); Stri

How to refresh data without destroying canvas

honey spoon I have a basic weather app that fetches data from forecast.io and displays icons with associated sky icons that draw and animate icons using html5 canvas Everything seems to be fine, but I have to update the weather periodically without refreshing

How to pause @RabbitListener without destroying AnonymousQueue

KeTr: I have a Spring Boot application that is normally message driven, but needs to stop incoming messages in special cases. However, I can't loose these messages, I need to buffer them and then receive them in the correct order. There are countless questions