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

Disable the meta tags in Zurb Foundation 5

I have searched extensively online but haven't been able to find a solution for this issue. How can I disable these zurb foundation 5 meta tags in the <head>: <meta class="foundation-mq-small"> <meta class="foundation-mq-small-only"> ...

Having Trouble Styling Radio Buttons with CSS

Hello, I'm facing an issue with hiding the radio button and replacing it with an image. I was successful in doing this for one set of radio buttons, but the second set in another row is not working properly. Additionally, when a radio button from the ...

"Enhancing the aesthetics: Stylish blue borders around Bootstrap

After successfully setting up bootstrap-select, I have noticed that blue borders are showing in two specific instances: 1) within the dropdown menu 2) when a new value is selected I have made some adjustments but the issue persists. Can someone please p ...

Sending files to the server through HTML5

Could someone assist me with uploading a file after it has been selected using HTML5? Here's the code snippet for selecting the file: <input type="file" .... /> The input field above allows you to choose a file, but I also need help with uploa ...

What is the best way to adjust the specific scope of every element generated by ng-repeat within a directive?

Attempting to simplify tables in Angular, I am working on a directive. My goal is for the user to only need to provide the list object and the formatting of each list element in the HTML, using the my-table tag as shown below... <h3>My Table</h3& ...

The 1st DIV element nudges the content within the 2nd DIV Element, causing it to stretch beyond the screen with 100%

I have gone through several other questions, but I am struggling to integrate the solutions into my problem. My main content DIV is set to 100% height and works perfectly fine until I add another element outside of the DIV towards the top of the browser. ...

Tips for utilizing identical properties across numerous styled elements:

Utilizing the styled-components library, I have enhanced the header components from the Blueprintjs library. The current template for the H6 component appears as follows: export const DH6 = styled(H6)` color: ${(props) => (props.white ? "white&qu ...

Utilizing either Maps or Objects in Typescript

I'm in the process of developing a simple Pizza Ordering App. The concept is, you select a pizza from a list and it's added to a summary that groups all the selections together. Here's how I want it to appear: Pizza Margarita 2x Pizza Sala ...

What is causing the issue with my CSS keyframe animation not functioning correctly when using `animation-direction: reverse`?

Exploring the use of animation-direction: reverse to streamline my CSS keyframe animation process. An interesting scenario arises when a container div is clicked, toggling an "active" class using jQuery to trigger the animation in either forward or backwar ...

Unable to click on hyperlink and image not adjusting in size

I am having an issue with the anchor tags inside a div. For some reason, the width and height are set to 0px, and I have tried to adjust them with no success. Each dot in my onepage scroller is meant to navigate to a different page. .dotstyle-scaleup{ f ...

Tips for resolving the issue of windows resizing due to off-screen elementsplacement:

During the development of a project, I wanted to incorporate an effect into my webpage. To achieve this, I positioned elements off the screen. However, upon running the code, the window resized with scrollbars, causing inconvenience for mobile users Below ...

Ways to enable automatic scrolling of a page as the content expands (Utilizing collapsible elements)

For a recent project I've been working on, I decided to include 4 collapsible text boxes. However, I encountered an issue where opening content1 would expand and push down content2-4, requiring the user to manually scroll to view the remaining collaps ...

What could be causing the image not to appear on the React app?

I'm currently working on a react website, and I'm facing an issue with the image display on the single product page. Despite trying to tweak both the react and CSS code, I haven't been able to resolve the problem. Below is my react file: im ...

Creating a design with CSS that features three main content columns of equal height, all of which are scrollable and have fluid heights, along with a sticky

After extensive research through various online resources, I have yet to find a solution to my specific CSS layout inquiry regarding "3 equal-height columns with a 'really' sticky footer". The desired layout includes the following components: ...

What is the reason for CSS to be included in the installation process when running npm install with [someLibraryName

After executing the following command: npm install vue-material I noticed that it installed and replaced some of the css styles in my application, leading to conflicts. To resolve this issue, I had to manually search for the specific piece of css and ove ...

Tips for ensuring the vertical scroll bar is always visible on a div element

I need help with maintaining a vertical scroll bar on a div regardless of its height. .myclass { overflow-y: scroll; } <div class="myclass"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the in ...

What is the best way to organize table rows into a single column when the window is resized?

I am working on a table that has three pictures in a row, with 100% width. I want the table to be responsive and stack the pictures into one column when the space is limited. The issue I am currently facing is that the elements of the table do not stack i ...

Is it possible to position two fixed divs side by side?

I am currently in the process of building my online portfolio. I am looking to create two fixed divs that will not scroll, each occupying the full height of the page. The content between these two divs should be scrollable while the bars on the left and ri ...

Troubles with CSS drop down alignment in Internet Explorer 7

I've been racking my brain all morning trying to solve this issue. My current project involves creating a website for a client, and I'm having trouble getting the dropdown menu to position correctly in IE7. It's working fine in all other br ...

When it comes to designing responsive websites, the use of `@

Being new to CSS, I am open to criticism and feedback. @media (max-width: 735px) {... } @media (min-width: 735px) {... } @media (width: 320px) {... } @media (width: 360px) {... } @media (width: 375px) {... } @media (width: 414px) {... } I have tried us ...