The boostrap grid system is malfunctioning and not behaving as anticipated

After reviewing the documentation, I came to understand the following:

xs = small devices like phones

sm = iPads and other tablets

md = smaller laptops

lg = big laptops and desktops

<div class="col-xs-12 col-md-4 col-lg-3">
      <div class="thumbnail"></div>
      ......
</div>

My expectation is that on mobile phones, the item will take up the full width with "gutters" on either side.

On tablets (sm), I anticipate it will take up 12 columns since I didn't specify anything for "sm."

For laptops (md), I expect three items per row.

And on larger screens (lg), four items per row.

To test responsiveness, I adjust my browser window size. However, when I shrink the window, the items end up being displayed one per row at their smallest sizes (xs and sm) but then they overflow and parts of them become unviewable.

I wonder if I misunderstood the grid system theory or if there's something wrong with what I'm doing.

Answer №1

It seems like a minor error has occurred.

To achieve full width for extra small and small screens, you can use col-xs-12 for the layout.

If you want 4 items per row on medium devices, make sure to use col-md-3 instead of col-md-4. The number 3 indicates how many columns it takes up out of 12 in each row. Therefore, col-md-3 will result in 4 items per row.

Similarly, for 3 items per row on large screens, use col-lg-4.

This adjustment should work well on larger displays.

I apologize for not fully grasping your point about overflowing. If you could share your code or a visual representation of what you are attempting to create, I may be able to provide more insight.

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

What causes the border to trigger the appearance of a scrollbar due to an overflow?

The first image display a scrollbar, while the second one does not. It all comes down to the .tabulator CSS class and specifically the border property. How come only a 1px border impacts the scroll feature instead of affecting the entire content? https: ...

Creating an interactive HTML form that updates in real-time based on user input can be achieved using vanilla JavaScript. This allows for a

I am working on a form that dynamically generates more form fields based on a user input value. <form> <input type="Number" name="delivery"> </form> For example, if the user enters '3', it should automat ...

How can "this" be properly utilized in jQuery?

I am attempting to retrieve the title attribute of an element from various elements with the same class, each having different attributes. This is my current approach: HTML <div title="title1" class="pager" onclick="location.href='link.aspx& ...

Image not showing up on Camera Feature

I've created a hybrid application that accesses the native camera on Android devices. Here is a snippet of my code: public class CameraFunActivity extends Activity { OpenCamera openCamera; /** Called when the activity is first created. */ ...

Exceeding the boundaries: Bootstrap 4 Tooltip escaping the div

When hovering over an anchor tag with tooltip attributes, the tooltip appears far away from the anchor tag. Here is the LINK - Even when inspecting element it seems to be positioned too far away. <a class="btn btn-secondary" data-toggle="tooltip" dat ...

What is the reason for the columns being divided on the xs-viewport in Bootstrap?

Attempting to grasp the concepts of Bootstrap has left me puzzled, as I cannot comprehend why the col-xs-11 is not aligning correctly with the col-xs-1. Despite having a total of 12 columns, the layout seems off. CSS: [class^="col-"] { height: 20px; ...

The initial value set for the innerHTML property of a div element

I have a requirement in my application where I need to confirm if the container div is empty before adding specific text elements to it. The innerHTML of this div is frequently created and removed within the app, so it's crucial to validate its emptin ...

Code Styling within Components of a React Application

I'm struggling with setting up inline CSS styles in my React App. I want to dynamically change the background color of my cards based on data in an array, but so far have been unsuccessful. I've created a variable with a switch statement and pass ...

Finding an element that lacks both a class and an id, and is not consistently present - what's the trick?

Currently, I am faced with a predicament in my code where a <li> element only appears under specific conditions, making it difficult to apply positioning. This element lacks an id and class attribute, which prevents me from targeting it accurately us ...

Tips for enhancing this CSS design to resemble a table

I am a beginner in working with CSS layouts for websites and I have implemented the following code that serves my purpose. Although it is currently functional, its functionality does not necessarily mean that it is well-written. Could someone review this ...

Trouble in Paradise: Woocommerce Product Grid in Disarray

Currently working on a WordPress WooCommerce website and encountering an issue with the product listing. Despite trying various plugins and CSS adjustments, I am unable to correct the positioning problem. Strangely, everything seems to be functioning prope ...

Discover html documents in a file structure using php and import them into a mysql database

I am facing an issue with my folder structure, which looks like the following example Groups - apple -- ahen45.html -- rev34.html -- ...... - bat -- fsf.html -- ere.html --.... ... The parent folder is 'Groups' and it contains subfolders lik ...

How to extract text from outside a tag using Selenium in Python3 with Chrome?

I am having trouble extracting text from outside of a tag. Currently, I am working with Python3.7 and I have experimented with both Selenium and BeautifulSoup4. Below is the HTML snippet I am dealing with: <br> <span class="label">Max. Allo ...

"Developing with create-react-app can be frustrating due to its sluggish performance and tendency

As I delve into the world of React, my lack of experience becomes evident. Each time I attempt to start a new project using the create-react-app command, I find myself waiting for what seems like an eternity. Discovering CodeSandbox was a game-changer - ...

Avoid displaying pop-up repeatedly (using current library)

I am currently customizing a Shopify theme that includes its own popup settings. I have created a new popup for my website that prompts visitors to choose their preferred language upon arrival. Everything seems to be working fine up to this point, but the ...

"Clicking on a link inside a div element using the onclick

Hey there! I'm having an issue with a div that contains a link with an onclick event (see the code snippet). Inside this div, there is another link that goes to a different page than the div itself. The code works perfectly fine in IE, Chrome, and Fir ...

Guide to placing a sticky div on the right side of your screen

I am trying to create a div with position: sticky within another div and make it stick to the bottom right corner of the screen when the parent div is on-screen. However, using right: 0 in the CSS doesn't seem to have any effect. When I use left: 100% ...

Utilize the inherited background color for a linear-gradient effect

Here is the code snippet I am working with: <label className={classes.trigger} htmlFor={uniqueId} ref={labelRef} style={{ background: val, borderColor: val }} /> This is the corresponding CSS: .trigger { display: block; posit ...

Hindering advancement: Bootstrap Form Wizard causing roadblocks

I am currently facing an issue with my form wizard setup. I want to prevent the user from advancing to the next step when the success key in my json is set to false. It seems like the project is utilizing the bootstrap wizard plugin. You can find more in ...

The hyperlink within the dropdown menu in HTML code is malfunctioning

I'm currently working on my personal website using HTML and CSS with textedit. I've successfully created functional links for the main navigation menu headings, but I'm encountering issues with the dropdown options. Whenever I try to click o ...