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

Attempting to display a larger version of an image sourced from miniature versions fetched with the assistance of PHP and

I'm dealing with the challenge of displaying thumbnails fetched from a database. PHP is successfully interacting with and presenting my thumbnails. I'm currently faced with the issue of passing the id from the database to the imageID in my JavaSc ...

Mocha refuses to continue running after completion when linking up with Mongoose

Actions speak louder than words Linus Torvald Conducting integration tests using mocha and supertest. Below is the code snippet: //app.js mongoose.Promise = global.Promise; mongoose.connect(config.mongoURL, error => { if (error) { throw error; ...

Why does the Vue router sometimes refresh the page instead of properly navigating to it? Can you spot the difference between these two code examples?

I am encountering an issue while trying to click on a "checkout" button that is supposed to send cart data to a backend and redirect me to a URL generated by the backend. Despite receiving a valid URL, my code is not functioning correctly. When I attempt ...

Sharing a JSON file with another address using Express.js

Currently embarking on my journey to learn Express. I am looking to send a JSON file to another location for processing after receiving it from a webhook request using a POST URL endpoint. The plan is to pass this JSON file to a CPP program. Below is the ...

Error encountered on macOS Mojave M1 when trying to set global permissions for npm bin folder

After running the npm doctor command, here is the output I received: npm ERR! checkFilesPermission Missing permissions on /opt/homebrew/bin/.keepme (expect: executable) Check Value Recommendation/Notes npm ping ...

"MongoDB's .find function functions properly in the shell environment, but encounters issues when

As a newcomer to Node Express Mongo, I decided to venture into creating my own website after following tutorials. The page I'm working on is a login page. While other people's code has worked for me, my attempt didn't go as planned. Even con ...

Converting JSON formatting from Object to Array: A Comprehensive Guide

Encountering another issue with changing the JSON array output. Struggling to figure out why it's not rendering the other files. Providing a clearer explanation below: In my code snippet, when I use data[name] = {, each return name is rendered into ...

An irritating bug causing a 1px difference in Chrome 21

Hey there, I've encountered a strange issue with the datepicker on this website. It works perfectly fine on IE8+, Firefox 14, Chrome 20, and Opera 12. However, as soon as Chrome updated to version 21, things went haywire! I'm baffled and can&apos ...

Selenium WebDriver: The challenge of using visibilityOfElementLocated when the element is not actually visible

I've encountered an issue with the Firefox Webdriver where it fails to accurately determine if an element is visible. Here is the code I am using, which incorrectly indicates that the element is visible: wait.ignoring(UnhandledAlertException.class).u ...

Leveraging Backbone.js without using client-side JavaScript

Exploring the idea of using Backbone.js and node.js to develop a compact web application. The concept of sharing code between the client and server is quite appealing. The challenge arises when considering how users without JavaScript-enabled browsers (in ...

Exploring the functionality of routes in Express.js and Socket.io, possibly delving into the broader concepts of

I am currently working on developing a multi-channel application using socket.io. The idea is for the channel to be determined by the URL that the user is on. Initially, I implemented the joining logic in app.js with hardcoded values and it worked fine. Ho ...

Utilizing Jquery for draggable/droppable functionality in combination with custom overflow styles

Encountering a challenge with a drag and drop system that utilizes CSS overflow properties to enable vertical scrolling of a list of values. The issue arises when dragging an item between selected and unselected areas, causing the dragged item to disappear ...

When you run the command npm -v, you will receive a response indicating the

Recently, I downloaded and installed the latest version of nodejs LTS from https://nodejs.org/en/. The installation process went smoothly without any issues. However, I encountered a peculiar error message when I ran npm -v in the command prompt. C:\ ...

Encountering an issue while trying to install node.js using puppet: package could not

I am currently in the process of setting up node.js on a Vagrant box using puppet. In my Vagrantfile (Debian Wheezy), I have configured it as follows: config.vm.provision :puppet, run: "always" do |puppet| puppet.manifests_path = "puppet/manifests" pu ...

Switch up the font style of the title element

Is it possible to modify the font-family of the title attribute in an input field using either JavaScript or jQuery? <input type="text" title="Enter Your Name" id="txtName" /> ...

Why is it that all my workers in node.js respond to a single incoming request?

In my current setup, I am utilizing node in combination with express as the web server, operating with a total of 4 workers within a cluster. The issue arises when an incoming request triggers responses from all workers. Each worker serves the same web ap ...

Difficulty with updating MongoDB records using Express.js PUT request

Currently, my focus is on a project that aims to be a simplified version of a social networking site. Although I have made progress, I am encountering challenges with creating a put request to update a numerical value in my mongodb. Specifically, I wish t ...

Persistent hover state remains on buttons following a click event

In my current project, I am dealing with a form that has two distinct states: editing and visible. When the user clicks on an icon to edit the form, two buttons appear at the bottom - one for saving changes and one for canceling. Upon clicking either of th ...

An issue occurred during the compilation of an Angular6 project

I am embarking on my first Angular project and may not grasp every detail perfectly. In my search for guidance, I came across the command "ng build --prod" on Google and decided to give it a try. Everything seemed to be going smoothly at first until an err ...

Modifying the background image of the <body> element in CSS to reflect the season based on the current month in the calendar

I'm struggling to change my HTML background based on the date. The code I've tried isn't working as expected and I can't seem to find any relevant examples to guide me. My goal is simple - I want the background of my HTML page to be ch ...