What steps can I take to prevent my Bootstrap grid from breaking?

What's on hand:

I have implemented Django to populate the Makes in a view.

Check out my template below:

<div class="container">
    <div class="row">
    <div class="btn-group" id="makesTable">
    {%  if makes %}
    {% for make in makes %}
    <button  type="button" name="button" class="btn btn-default" id="{{ make.id }}">
        <br />
        <img class="center-block" src="[REDACTED]"  />
        <br />
        <p>{{ make.name }}</p>
    </button>
    {% endfor %}
{% endif %}
</div>
</div>
</div>

Here is the resultant HTML5 output:

<div class="container">
 <div class="row">
  <div class="btn-group" id="makesTable">
    <button  type="button" name="button" class="btn btn-default" id="1">
        <br />
        <img class="center-block" src="/static/IQC/assets/img/gallery/brands/128/Acura.png"  />
        <br />
        <p>Acura</p>
    </button>

    <button  type="button" name="button" class="btn btn-default" id="2">
        <br />
        <img class="center-block" src="/static/IQC/assets/img/gallery/brands/128/Alfa%20Romero.png"  />
        <br />
        <p>Alfa Romeo</p>
    </button>

    <button  type="button" name="button" class="btn btn-default" id="3">
        <br />
        <img class="center-block" src="/static/IQC/assets/img/gallery/brands/128/Audi.png"  />
        <br />
        <p>Audi</p>
    </button>
</div>
 </div>
  </div>

Presently, I am facing an obstacle with responsive design. My goal is to arrange the buttons in a 5x7 grid, however, at times, I encounter the following issue:

This is how I envision it to appear

This is how it malfunctions

Answer №1

To resolve the problem, simply apply box-sizing: border-box;.

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

Tips for increasing the efficiency of my Django project

Transitioning from classic ASP, we have embarked on developing a large Django application. Our main challenge now is how to effectively segment the code for this project into manageable parts. Let's consider the scenario where we have CLIENTS with a ...

Video tag with centered image

For a current project, I am in need of rendering a centered image (a play button) at runtime on top of a video based on the UserAgent. If the userAgent is not Firefox, I want to display the image as Firefox has its own playEvent and button on top of the vi ...

Encountered an error while attempting to minify code during the npm run build

After completing my react application using create-react-app , I encountered an issue when trying to build it with npm-build. While there were no problems running it locally with npm start, I faced an error during minification of the code. I attempted ...

How to play two audio files at the same time on iOS Safari

I encountered a unique challenge in Javascript when attempting to play two audio files simultaneously on iOS Safari. One file is the voice script, while the other serves as background sound playing on loop. The code snippet I utilized for this task is as f ...

Adjust the alignment of points in JQuery UI slider values

Currently, I am utilizing jQuery UI slider with 6 points along with 6 divs positioned above the slider. My goal is to align the points in the middle of each div located above the slider. Is there a method available to specify the position of values in jQu ...

Utilize an array of JSON objects to populate an array of interfaces in Angular/Typescript

I am currently facing a dilemma - my code is functioning without any errors when executed, but my text editor is flagging an issue stating that the property 'categories' does not exist on type 'CategoryInterface[]' (specifically on the ...

Steps to transfer selected autocomplete value ID to data attribute using jQuery

I am working on a project where I need to store the State ID in my database instead of the State Name. Currently, I am using an autocomplete query to select the State. How can I pass the selected State's respective ID to the data-attribute of the inpu ...

Adding the output of a function to a <p> tag in Django

I need assistance with printing the output of a function I have created within my Django web application. The goal is to display the results in a <p> tag once a button on the same HTML page is clicked. Below is the function: def Question_Init(): B ...

How can I display posts from various categories on separate pages in WordPress?

Currently tinkering with a WordPress theme and I'm hoping to display posts on various pages based on their categories. For instance, let's say the page is titled "Blog" and the post category is labeled as postBlog. Can anyone guide me on how to ...

Encrypting and decrypting data using RSA in TypeScript

Currently, I am utilizing Angular 4 to develop the front end of my application. For authentication, I have integrated OAuth2 on the backend (which is created using Spring in Java), ensuring that only authorized individuals can access my app. However, ther ...

Stopping the papaparse streaming process once a certain number of results have been achieved

Currently, I am utilizing the PapaParse library to parse a large CSV file in chunk mode. During my data validation process, I encountered an issue where I was unable to stop streaming the data once validation failed. I attempted to halt the streaming by ...

The table's value remains unchanged despite updating the data in $localStorage using AngularJS

In my AngularJS project, I have implemented two components. The first component, usersList, consists of a table: <table> <tbody> <tr ng-repeat="..."><!--Contains code to repeat the entries in usersList localstorage object-->& ...

Using PHP to dynamically pull and update webpage content directly from the database

Currently, I am utilizing PHP to upload information into a database and then using PHP again to display that data. In the code snippet provided below, PHP is used to exhibit all the content stored in the database. Each row within the database table will b ...

The addition of meshes in real-time leads to a decrease in control responsiveness

I'm currently working on creating a 3D map using Three.js. My process involves building the geometry and texture with images of size 256x256 pixels, then constructing a THREE.Mesh to add to the scene upon completion. However, I've noticed that ...

Incorrect colors are shown by Electron and Webkit browsers

As I work on developing an application using Electron, I encountered a curious color discrepancy. In Adobe XD, the color reads as rgb(0,55,200), but when I input this exact value into my app created with Electron, the displayed color shifts to rgb(4,48,193 ...

The Sacred Chalice Trio Vertical Stretch Design

Recently, I've been working on creating a three column layout with percentage width. I stumbled upon the concept of the Holy Grail web design through some online articles and resources. To implement this layout, I referred to an example from The Perfe ...

Can anyone provide assistance with understanding the background-size property?

I am struggling to resize the background image on my website, similar to the one on this website. No matter what I try with the position or background-size property, the image remains too large and does not adjust properly. Additionally, I need the image t ...

Conditionally displaying components in React by dynamically rendering them

I have developed a feature that generates a text box dynamically every time a button is clicked import React, { useState } from "react"; import ReactDOM from "react-dom"; const Input = () => { return <input placeholder="Yo ...

Custom server-side methods in SignalR

Not long ago, I was puzzled as to why clients were not triggering any server-side code. No one had an answer, but after some more investigation, I discovered that the clients do actually get registered on the server. When I override the onConnect method on ...

Utilizing Bootstrap 5: Breaking a Page into Two Separate Vertical Sections

I am looking to design a unique grid system that divides the page into either 2 columns or 2 rows that are completely separate from each other. This means that the content on one side of the page does not expand to match the height of the content on the ot ...