Flex items refusing to wrap in Firefox

I am facing an issue with my layout setup in different browsers. When I have a list of divs inside a flex div, it displays correctly in Chrome:

However, in Firefox, it only shows a horizontal scroll with one line.

Is there a way to prevent the forced horizontal scroll in Firefox and make it display like it does in Chrome?

#maindiv{
    margin: auto;
    width: 97%;
    border: 1px solid #F4F4F4;
    border-radius: 2px;
    margin-top: 10px;
    -webkit-justify-content: space-around;
    -webkit-flex-wrap: wrap;
    -moz-justify-content: space-around;
    -moz-flex-wrap: wrap;
    -ms-justify-content: space-around;
    -ms-flex-wrap: wrap;
    justify-content: space-around;
    flex-wrap: wrap;
    display: -webkit-flex;
    display: flex;
    display: -moz-box;
    -moz-box-pack: center;
    -moz-box-align: center;
    height: 395px;
    max-height: 395px;
    overflow-y: scroll;
}

#divslist{
    list-style: none;
    margin: 0px;
    float: left;
    position: relative;
    zoom: 1;
    -webkit-justify-content: space-around;
    -webkit-flex-wrap: wrap;
    -moz-justify-content: space-around;
    -moz-flex-wrap: wrap;
    -ms-justify-content: space-around;
    -ms-flex-wrap: wrap;
    justify-content: space-around;
    flex-wrap: wrap;
    display: -webkit-flex;
    display: flex;
    display: -moz-box;
    -moz-box-pack: center;
    -moz-box-align: end;
}

Answer №1

Just made a slight adjustment to the CSS code:


display: -webkit-flex;
display: -moz-box;
display: flex;

Changed from


display: -webkit-flex;
display: flex;
display: -moz-box;

Tested and confirmed working on Firefox 28. You can view the updated code in this JSFiddle link for both Firefox and Chrome.

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

Leveraging the power of PHP variables within jQuery code

Wondering how to incorporate a PHP value into jQuery? My approach involves retrieving the VAT rate from the database using PHP and storing it in $vatrate: $sqlv = <<<SQL SELECT * FROM `vatrate` WHERE id='1' SQL; if(!$resultv = $db-&g ...

The jQuery dropdown menu smoothly expands to reveal all hidden submenu options

I'm currently encountering an issue with jQuery. I am trying to create a responsive drop-down menu with sub-menus. The behavior I want is that if the window width is less than 700px, the submenus will trigger onClick. And if the window is wider than 7 ...

Implementing a JavaScript function that directs to the current page

I have set up my index page with a link that looks like this: <li onClick="CreateUser()"> <a href="#CreateUser">CreateUser</a> </li> When the "Create User" list item is clicked, the main page content is populated as follows: fun ...

Injecting Javascript before page code in Chrome Extension Content Script allows for manipulation of webpage elements

I am currently working on developing a Chrome extension that involves injecting a script into a webpage before any other scripts present. This is crucial for my project as I am utilizing the xhook library to intercept XHR requests, which necessitates overw ...

Column count pseudo class is malfunctioning on Safari browser

Why is the pseudo class with column count not working in the Safari browser? I have captured two screenshots to illustrate this issue. 1. Firefox browser screenshot https://i.sstatic.net/27uoI.png 2. Safari browser screenshot https://i.sstatic.net/vRN ...

Is there a way to locate ComputedStyle elements using Nokogiri?

I am currently using Ruby along with Nokogiri to parse through HTML documents. I am looking to select all nodes that match a CSS class with the style attribute display: none, but the CSS class is unknown in advance. For example: <html> <body&g ...

What is the best way to trigger card opening - through clicking or hovering?

Once the Set tag/status button on the left is clicked, I aim to display a card similar to this one on the right side. What would be the best approach to achieve this in React? Should I use regular CSS, Material UI, or React-bootstrap? https://i.stack.img ...

Ways to generate a unique link for every value in an option tag dynamically?

I'm currently working on a form that allows customers to buy an online service. Within the form, there's a dropdown list featuring 'select' and 'option' tags. This dropdown menu lets users pick a billing cycle (6 months, 1 ...

Creating an HTML button to reveal additional text on the same page

Currently, I am working on a project involving html and javascript. My issue lies in displaying multiple options on the same webpage without switching pages. Essentially, I have a plot and a few buttons on one page, and when a user clicks on any of these b ...

I am attempting to build a party planning website but I am encountering an issue where the output is not generating properly. Whenever I click on the submit button, the information I input

I am struggling to create a party planner website and encountering issues with the output. Whenever I click on the submit button, the form just clears out without any feedback or result. Here is what the expected output should be: Validate event date 1: ...

reduce opacity of specified div background

Objective / Purpose I am working with multiple div elements and I want to assign two distinct classes to each of them, each serving a different purpose within my application. One class should determine the level, influencing the color of the div. The oth ...

Using Puppeteer to Retrieve Data from a Web Page with Multiple Divs of the Same Class

I am in the process of creating a puppeteer script to scrape an announcements website. The challenge I am facing is how to extract the content of each page element with the same class using a loop. Upon inspecting the DOM, it's evident that all the co ...

Extract the image URL from the href attribute using Xpath

My goal is to extract all images enclosed in href attributes from the given code snippet <div class="jcarousel product-imagethumb-alt" data-jcarousel="true"> <ul> <li> <a href="https://domain/imagefull.jpg" onclick="return false;" cla ...

Resetting an Angular Material select component

I've encountered an issue with Angular Material. Currently, I have a form with two select elements. The problem arises when I choose a value in one of the selects, it resets and loses its value. Could this be a bug? Or am I possibly making a mistake ...

Setting up an i18n project in AngularJS

I just embarked on my angularjs journey yesterday with little to no prior knowledge about it. My initial goal is to centralize all the labels for my UI in a file (to facilitate swapping them out for i18n). As far as I know, this can be achieved by importi ...

The ul element does not encompass all child elements in terms of size

I have been working on creating a tabbed navigation component using HTML, and my code looks like this: <ul class="nav"> <li class="selected">Selected Tab</li> <li><a href="#">Not-selected Tab</a></li> ...

To avoid truncation issues, consider inserting a plus sign following the ellipsis in the text-overflow property

Hey there! I have a table that contains some text and I'm looking to shorten the text after it reaches a certain length. I was able to achieve this using the text-overflow property. .overflow { width: 70px; overflow: hidden; text-overflow: elli ...

Gathering information from an HTML form and displaying it through JavaScript by utilizing Bootstrap's card component

I've been working on integrating form data from my index.html page into a card component using Bootstrap. I've successfully collected the data in the backend, but now I'm struggling to display it on the frontend as a card component. Any help ...

Retrieve the data file using input text with jQuery

Is there a way to extract data like this? data:application/pdf;base64,JVBERi0xLjQKJeHp69MKMSAwIG9iago8PC9UeXBlIC9DYXR…AKdHJhaWxlcgo8PC9TaXplIDE4Ci9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjg4MzEzCiUlRU9G from an input file? $('#file').change(functio ...

Rotating 3D cube with CSS, adjusting height during transition

I'm attempting to create a basic 2-sided cube rotation. Following the rotation, my goal is to click on one of the sides and have its height increase. However, I've run into an issue where the transition occurs from the middle instead of from the ...