Issues with the alignment of items in an item grid in CSS/HTML are causing the display to appear

I am experiencing an issue with the CSS formatting of a section on my website. The products in the product grid do not display properly in order when the screen size is too small.

For instance, if you visit this specific site: and view it on a screen larger than 30", you will notice that all items are aligned perfectly next to each other in the grid mode.

However, when accessing the site on a smaller screen (around 24" or less), the products appear in irregular rows such as having 2 in one row, then 1 in another row, followed by 2 again.

How can I adjust the alignment so that all products display nicely beside each other without any irregular rows? Thank you for your help!

I am using Magento Go platform, and you can inspect the CSS using your browser's development tool.

Thank you!

Answer №1

If you want to align your items properly in 4 columns, but are experiencing issues with the image when the screen size changes, try the following code:

.products-grid li.item{
    width: 225px; // Delete this line and add the following style
    width:24%;
}
.products-grid .product-image{
    width: 225px; // Delete this line and add the following style
    width:100%;
}

Alternatively, you can also consider using:

In order to adjust the column count from 4 to 3 on the category page, insert the code below into your app/design/frontend/your_package/your_theme/layout/local.xml file:

<catalog_category_default>
    <reference name="product_list">
        <action method="setColumnCount"><count>3</count></action>
    </reference>
</catalog_category_default>
<catalog_category_layered>
    <reference name="product_list">
        <action method="setColumnCount"><count>3</count></action>
    </reference>
</catalog_category_layered>

To consistently align the list items in 3 columns for all screens, apply the following CSS:

.products-grid li.item{
    width: 225px;
    float:left; //Remove this line
    display:inline; //Remove this line
    display:inline-block; //Add this line
    margin-right:1px; // Remove this line
}

This approach will ensure that 3 items are displayed in a row on every screen, as the display property is set to inline-block, automatically adjusting the margin for proper positioning.

Feel free to give it a try!

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

"Is there a way to assign a default value to a select element while also using ng-model and ng-change in AngularJS

My reason for this question is that I have encountered a situation where ng-model is overriding the default value in the select tag. Therefore, I am looking to establish <option value="-translation.published_at" selected>{{ 'Newest first' | ...

Load the flexslider once the fancybox container is opened

In my experience, I have found flexslider and fancybox to be very useful plugins. Individually, they work perfectly fine on a website that I am currently working on. However, when I tried placing a flexslider gallery inside a fancybox div, I encountered a ...

Error Message: "BlurbError on /taskapp/taskapp-board/ Failed to parse the remaining: '(status='fresh')' from 'tasks.filter(status='fresh')'"

I encountered an error known as "TemplateSyntaxError." I have created a project that manages tasks, and within this app, I developed a task-board.html page to handle user tasks. This page consists of three sections: 1) Add New Task, 2) In-progress Tasks, a ...

Displaying and hiding a large image using jQuery's mouseover event

I'm currently utilizing this jQuery script to toggle the visibility of an image with a fixed position: $(document).on('mouseover',".multiverseid", function (e) { var mid = $(this).attr("id"); $('#picture').attr('s ...

Is it possible to create a mouse-following effect with lighting using Javascript

Recently, I've been honing my Javascript skills and decided to create a follow-mouse function. After successfully implementing it, I started brainstorming a new concept that I'm unsure is achievable. Is there a way to develop an "orb of vision" ...

Error: AngularJS: Invalid Argument Error. The argument 'ClientCtrl' is not defined as a function, it is currently undefined

As a newcomer to AngularJS, I am facing an issue while trying to add a controller to my website. Strangely, the other two controllers are functioning perfectly fine, but this particular one is not being recognized. Here is my app.js file: var app = angul ...

It's perfectly fine to use CSS href online, but when attempting to download the CSS file and use it locally, it doesn't seem to

I am currently working on a personal website project and I decided to use an HTML template from W3Schools. The template includes CSS files sourced from the internet: <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link re ...

Why does my Bootstrap 4 grid column seem to be devouring the rest of the columns?

Currently, I am delving into the world of Bootstrap 4 grid. My focus right now is experimenting with creating responsive boxes that adjust based on window size changes. In my design, these are how the boxes should respond: Large: Box 1, Box 2, Box 3, Box ...

What causes the disparity between Chrome's print preview and printed output? [HTML - CSS]

In my Angular demo project, I have included basic text and a table. There is a print button that calls window.print() to print the page with applied styling. printPage() { window.print(); } CSS: @media print { @page { size: landscap ...

Transform audio data URI string into a downloadable file

The audio data is stored by the server as a base64 data string, which is then retrieved and played by the mobile web client. However, there seems to be a problem with playing the audio on mobile Chrome in iOS and Android when using a data uri (issue). I ...

The peculiar characteristics of border-radius

Discovering a new way to create elliptical border-radius has opened up my design options. border-radius: horizontal radius / vertical radius At first, I experimented with border-radius: 10px 20px/10px, and it worked perfectly. But when I tested border-r ...

Discover the contents within #document utilizing PUPPETEER

Can someone assist me as I am new here? I am trying to retrieve elements from a virtual reference #document in HTML using Puppeteer, but every time I attempt it, I receive an error stating that the element does not exist. Here are some examples: HTML &l ...

The local() function in CSS @font-face is limited to finding only the "regular" and "bold" font styles, not others

Recently, I added some new fonts (specifically Roboto) to my Linux Ubuntu PC and wanted to incorporate them into my CSS using the @font-face rule. However, I encountered an issue when specifying different font weights within the src: ; property as shown in ...

Is anyone experiencing difficulties with IOS 8.3 when trying to assign colors to Font Awesome icons using content?

I'm encountering an issue on IOS 8.3 where I click a checkbox and the arrow color should be green, but it shows up as black instead. Is there a bug fix for this in IOS or is it simply not supported? Here is my SASS/css code: input[type="checkbox"] ...

Troublesome Display of Badges in Bootstrap 5

My goal is to include a badge on a label, however all it does is change the text color to white <asp:Label CssClass="badge badge-pill badge-success" ID="Label1" runat="server" Text="Label"></asp:Label> ...

Guide on reusing javascript to toggle between image sources

I have a simple website with buttons that, when clicked, change the image being displayed. However, I find myself repeating code for each button, and I'm wondering if there is a more efficient solution to this problem. Here is an example of what I cu ...

Creating an unordered list (ul) with list items (li) that extend the full width

Having trouble making my list items (li) from the unordered list (ul) stretch across the page like the navigation bars on websites such as Verragio and James Allen. Can someone assist me with this? Here is a basic example of a nav hover bar. .dropdown-b ...

The issue arises from the fact that the Bootstrap modal fails to open automatically

Having trouble getting my bootstrap modal to open on page load, even though the button to trigger it is working fine. Here is my code: <div id="myModal" class="modal fade" role="dialog"> <div class=" ...

Having trouble toggling journal entries in an HTML journal? The Jquery function might not be working properly

I have been tasked with creating a civil war journal for my 8th grade Social Studies class and I decided to present it as an HTML file featuring the title and date of each journal entry. The goal is to allow users to click on each entry to open it while au ...

What is the best way to select the child of the second-to-last child?

In the structure of my HTML code, I have an unordered list with a class "menu" containing several list items and corresponding anchor tags like this <ul class="menu"> <li> <a href="#1"></a> </li> <div&g ...