Troubleshooting Bootstrap image alignment problem with columns on extra small screens

My website showcases screenshots of my software in a div element. Everything looks great on larger screens, but once I switch to a phone or resize the window, the images don't align properly, leaving empty space. Refer to the image below for clarification.

https://i.stack.imgur.com/F4Dnc.png

Below is the code from the index page. I believe it should work without any modifications.

Here are some things that I have tried: - Removing the container and row classes. - Adjusting the width of the images down to 80% (even though 100% should work). - Adding class="img-responsive" as suggested in another thread. - Removing margins and padding for the divs containing the images.

<!-- Screenshots -->
<div id="screenshots">
    <div class="container">
    <br>
        <div class="row text-center"> <!-- Screenshot DIV -->
            <h2>Screenshots</h2>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/dashboard.png" alt="Dashboard SS" class="img-responsive" width="100%" />
            </div>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/lotmanager.png" alt="Lot Manager SS" class="img-responsive" width="100%" />
            </div>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/register.png" alt="Register SS" class="img-responsive" width="100%" />
            </div>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/sell.png" alt="Auction SS" class="img-responsive" width="100%" />
            </div>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/checkout.png" alt="Checkout SS" class="img-responsive" width="100%"/>
            </div>
            <div class="col-md-2 col-xs-6">
                <img src="images/screenshots/samplereceipt.png" alt="Receipt SS" class="img-responsive" width="100%" />
            </div>
        </div><!-- /.Screenshot DIV -->
        <br>
    </div><!-- /.container -->
</div><!-- /.screenshots -->

I would appreciate any help with this issue.

Answer №1

There's a Mistake in the Code, Please verify and rectify /h2

<h2>Screenshots</h2>

Answer №2

The reason for the discrepancy in height is due to variations in image sizes. To resolve this issue, consider setting the parent div of the images to the maximum height within the group.

let maxHeight;
$('#screenshots .container > div > img').each(function(){
let currHeight = $(this).height();
if(maxHeight < currHeight) {
maxHeight = currHeight;
}
});
if(window.width() < 768) {
$('#screenshots .container > div').hieght(maxHeight);
}

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

Focus on a particular div in order to enable scrolling beyond its boundaries

Whenever I move my mouse over the div tag, I am able to scroll the content. However, if I move the mouse outside of the div box, scrolling stops. Is there a way to make the specific div element track the mouse pointer no matter where it goes? <div st ...

Determining the worth of radio buttons, dropdown menus, and checkboxes

I am working on designing a menu for a pizza place as part of a learning project. The menu allows users to select their pizza size from small, medium, and large using radio buttons, and then customize it further with three select boxes where each selection ...

Reduce whitespace when resizing

Is there a way to adjust the content to fill in the margin space when the browser is resized smaller? http://jsfiddle.net/denWG/62/ Html: <div class="jp-sleek jp-jplayer jp-audio"> <div class="jp-gui"> <div class="jp-controls jp-ico ...

With jQuery fadeout, hyperlinks remain visible even after being clicked on

<a target="_blank" href="https://example.com"> <img class="bcvc_ad1" src="http://bdeas.com/wp-content/uploads/2015/08/ad1.jpg" alt="ad1" width="80" height="80" /> & ...

The list countdown for loop only appears in the initial iteration

Hey there, I'm currently facing an issue with duplicating my JavaScript countdowns and displaying images of cards on each loop iteration. Strangely, the countdown only appears in the first instance even though it's within the loop. I'm seeki ...

Text will not be moved to a new line

Hello, I am encountering an issue with my messaging system where the messages retrieved from the database are not properly going to a new line in the window. Despite adjusting the width, the messages continue to overlap. Below is the code snippet: This co ...

Achieve vertical center alignment of items using flexbox styling

I'm attempting to vertically center elements using CSS flexbox. I have successfully implemented it with the non-vendor-prefixed code, but I am facing issues in Webkit (Chrome) even with the vendor prefixes. My goal is to vertically align the spans wi ...

What is the best way to use CSS to evenly lay out a group of dynamically generated buttons?

My Vue-generated buttons need to be evenly laid out on the bottom of the page, with equal space on the left and right. The mdui button style I am using has fixed width and height, so I have to decide between a single row for fewer buttons (less than three ...

Can multiple links be hrefed at the same time?

On my website, I have a particular anchor tag that links to another page: <li><a class="dropdown-item" href="/<%= term._id %>"><%= term.term %></a></li> Now, I am looking to add an additional href li ...

Tips for positioning slideshow below header in web design

I am currently working on enhancing the slideshow feature on my website. If you take a look at the image link provided below, you'll notice that the alignment of the slideshow is slightly off on both sides. Despite my attempts to adjust the CSS width ...

retrieving dynamic data from an HTML form to JavaScript

Currently, I am dynamically adding elements using JavaScript. The count is defined and increases by one. <span style="margin-left:10px;">File Type : <select name="select_type_'+count+'" > <option value="select">Select</optio ...

Utilizing CSS for displaying and hiding content based on its unique identifier

Is it possible to show/hide a div using only CSS based on its ID? Showcasing this functionality in jQuery or vanilla JavaScript is straightforward, but can the same effect be achieved with pure CSS? The checkbox hack requires a specific structure to func ...

Loading a .css file in advance using NextJS

We have integrated NextJS and Material-UI into our website, but we are facing an issue with FOUC (Flash of Unstyled Content) upon page loading. After some investigation, I discovered that the JS files are loading faster than the CSS file, causing the probl ...

What is the best way to create a JavaScript Up/Down Numeric input box using jQuery?

So, I have this Numeric input box with Up/Down buttons: HTML Markup: <div class="rotatortextbox"> <asp:TextBox ID="txtrunningtimeforfirstlot" ClientIDMode="Static" runat="server">0</asp:TextBox> (In mins) </div> <div cl ...

Converting HTML content into Java objects

I have a log of messages from a messaging platform saved in HTML format. Each message is displayed as follows: <div class="message"> <div class="message_header"> <span class="user">User Name</span> <span class="meta"&g ...

Slider with a progress bar

Have you ever wondered if it's possible to create a progress bar using an input range? Imagine someone entering a number and the bar moves to the right, changing its background color on the left side of the thumb based on the size of the number. Check ...

The Street View feature on Google Maps API is now showcasing a cool,

I have been attempting to showcase the interior of various businesses using the Google Maps API street view feature. Initially, I was able to retrieve the place_id and then use it to access any available street view panoramas. However, this functionality s ...

Is there a way to change the text (price) when I select an option?

<div class="single-pro-details"> <!--Customize in the CSS--> <h6>Home / Beats</h6> <h4>Unique Lil Tecca Type Beat - New Love</h4> <h2 id="price">$ ...

Determining User Consent: A Straightforward Guide to Identifying Previously Accepted Cookie Consent

I've been tasked with adding a cookie to a website. The site only tracks the number of visits, so there is no user-specific data available for cookie assignment or acknowledgment tracking. Is it possible to show the cookie notification only to users ...

Eliminating gaps between elements

I recently delved into the world of web design, and although I have a basic understanding of HTML and CSS, I am determined to enhance my skills and knowledge by creating a standard home page. So far, I managed to create a standard navigation bar, and now ...