What could be causing my Bootstrap (3) grid to not display responsively?

It seems like there may be a simple oversight in my code, as I'm unable to make my Bootstrap grid responsive. I have successfully passed item data through Node and am able to display a grid of item thumbnails with captions in rows of 4. However, when I resize the page, the images just shrink instead of breaking into rows of 2 items and eventually one item as the screen width decreases, as intended with the col-sm-6. What could be causing this issue?

    <div class="row text-center" style="display:flex; flex-wrap:wrap">
        <% items.forEach(function(item){ %>
        <div class="col-md-3 col-sm-6">
            <div class="thumbnail">
                <img src="<%= item.image %>">
                <div class="caption">
                    <h4><%= item.name %> </h4>
                </div>
            </div>
        </div>
        <% }); %>
    </div>
    </div>

Answer №1

So, I gave it a shot and surprisingly, it's working perfectly:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<div class="row text-center" style="display:flex; flex-wrap:wrap">
  <div class="col-md-3 col-sm-6">
    <div class="thumbnail">
      <img src="https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
      <div class="caption">
        <h4>test </h4>
      </div>
    </div>
  </div>
  <div class="col-md-3 col-sm-6">
    <div class="thumbnail">
      <img src="https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
      <div class="caption">
        <h4>test </h4>
      </div>
    </div>
  </div>
  <div class="col-md-3 col-sm-6">
    <div class="thumbnail">
      <img src="https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
      <div class="caption">
        <h4>test </h4>
      </div>
    </div>
  </div>
  <div class="col-md-3 col-sm-6">
    <div class="thumbnail">
      <img src="https://www.google.fr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png">
      <div class="caption">
        <h4>test </h4>
      </div>
    </div>
  </div>
</div>
</div>

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

Error: Unable to find axios module

screenshot of browser developer tool - network I have embedded the script in my base.pug file script(scr='https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js') Upon loading the page and inspecting the browser developer tool > netw ...

What is the reasoning behind express-session generating an array for Set-Cookie?

Can you explain the purpose of this code snippet from the source code of express-session: function setcookie(res, name, val, secret, options) { var signed = 's:' + signature.sign(val, secret); var data = cookie.serialize(name, signed, options ...

Basic color scheme

I'm attempting to change the background color behind a partially transparent .png div. The CSS class that modifies the div is ".alert". Manually editing the .alert class background color works perfectly, and now I want to automate this on a 1-second c ...

Vue Issue - Unable to resolve 'https' dependency when importing library

Currently, I am working on a Vue project and attempting to utilize an npm package for interfacing with the retroachievements.org API in order to retrieve data. However, I have encountered an error during this process. Below is a detailed account of how I c ...

The collapse feature in Bootstrap Reactstrap is having issues when used with a set of components

Struggling to understand why my list of components isn't collapsing at all. It seems like I'm missing a tiny detail because no matter what I try with <div> and <p> tags, nothing changes. component import React, { useState } from "rea ...

Error in Firefox: "Anticipated media feature name, but discovered 'hover'"

I am trying to style elements differently based on whether the client browser supports hovering or not. I came across media features as a solution and implemented it in the following way: /* Supports hovering */ @media (hover: hover) { ... } /* Does not ...

Elevate your Material UI Avatar with an added level of

Attempting to give a MUI Avatar component some elevation or shadow according to the documentation provided here. <Avatar alt="Cindy Baker" src="/static/images/avatar/3.jpg" /> Enclosing the Avatar within a paper or Card element increases the size o ...

Node.js app running in Docker container does not seem to be listening on the designated

I've been developing a node.js web application and I typically test it by sending requests from Postman to localhost:8080. When I run the application (npm start) without Docker, everything works perfectly and the app is running and listening on port 8 ...

What is the best way to simulate an overloaded method in jest?

When working with the jsonwebtoken library to verify tokens in my module, I encountered a situation where the verify method is exported multiple times with different signatures. export function verify(token: string, secretOrPublicKey: Secret, options?: Ve ...

Resolve a container overflow problem within the footer section

Trying to adjust the footer (newsletter signup form) on this page to fall to the bottom of the page has been a challenge. The #container element appears to be larger than the body, causing layout issues. Any suggestions on how to resolve this? An image d ...

Transforming Your Local Development Environment: Simulating AWS Parameter Store for Lambda Function Testing

Currently, my AWS Lambda function is being developed using the Serverless framework and NodeJS. Secrets have been stored in a .env file up until this point, allowing access to them in the serverless.yml file like so: provider: ... environment: DB_H ...

Utilizing Jade templates for building a dynamic website with Node.js and Express

When working with a Jade template, how do you apply it? The example on the Jade website only demonstrates the conversion from Jade to HTML, but does not explain the process of actually implementing this transformation. Do you need to save the file with a s ...

Creating a wrapper from index.d.ts in Kotlin JS

I am currently exploring the possibility of utilizing Kotlin JS for an express application. It has come to my attention that there is no full, current wrapper available for express, however the package includes type definitions in its index.d.ts file. I&ap ...

Having trouble with installing NPM and ng commands, neither of them is working. I may have to uninstall everything and begin from scratch

Learning Angular and how to use the terminal is all new to me. I recently installed NPM and attempted to use ng serve, but encountered a series of issues. At this point, I am considering completely uninstalling everything so I can start fresh. I've d ...

Attempting to trigger the timer to begin counting down upon accessing the webpage

Take a look at this example I put together in a fiddle: https://jsfiddle.net/r5yj99bs/1/ I'm aiming to kickstart as soon as the page loads, while still providing the option to pause/resume. Is there a way to show the remaining time as '5 minute ...

I am unable to execute npm run dev

I attempted to replicate my friend's project from Git, but encountered an issue: Vite manifest not found at: D:\laravel\PBL-Kelompok-5-2\public\build/manifest.json Start the development server Run npm run dev in your terminal and ...

The Angular2-Recaptcha feature fails to load when navigating back in the browser

As I delve into the world of Angular Application development, I encounter an issue with Recaptcha. Everything works smoothly during application initialization. However, upon navigating to the next page and then attempting to go back using the browser' ...

Displaying images dynamically in a gridview from a hard drive source

I am facing an issue trying to dynamically retrieve an image from my hard drive. Despite creating the dynamic path correctly, the image is not displaying. The root cause of this problem lies in the fact that I am developing a back-end system for a website ...

Exploring the difference between loop and stream patterns in Azure Service Bus message receiving operations

I am currently setting up the Azure Service Bus messaging infrastructure for my team, and I am working on establishing best practices for developing Service Bus message receivers. We are in the process of creating a new service to consume the Service Bus m ...

Customize Metadata Efficiently with NextJS 13 - Eliminate Redundant Requests

Imagine you have a server-side component located in the app directory called page.js, which represents a person: export default async function Person({ params }) { const person = await getPerson(params.id); return ( <h1> {person. ...