The CSS Columns layout feature is not functioning properly in Firefox browser

I attempted to design a layout with 5 columns where the height adjusts based on its content, so I couldn't set a fixed height. However, my codepen project isn't functioning as expected. Visit this link to view it.

body {
  height: 100%;
}

#outer-container {
  display: flex;
  flex-direction: row;
  height: 100%;
}

#inner-container {
  flex-grow: 1;
  column-count: 5;
  height: 100%;
}

.item {
  break-inside: avoid;
  height: 100%;
}
<div id="outer-container">
  <div id="inner-container">
    <div class="item item-1">
      <b>Col 1</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type sp
    </div>
    <div class="item item-2">
      <b>Col 2</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-3">
      <b>Col 3</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-4">
      <b>Col 4</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-5">
      <b>Col 5</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type sp
    </div>
  </div>
</div>

Answer №1

Feel free to try out the CSS code below, it has been tested and found to work perfectly on both Chrome and Mozilla Firefox browsers.

#inner-container {
display: flex;
flex-direction: row;
align-items: stretch;
}

.item {
      flex-basis: calc(100% / 5);
      border:1px solid #000;
}
<div id="outer-container">
  <div id="inner-container">
    <div class="item item-1">
      <b>Col 1</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type sp
    </div>
    <div class="item item-2">
      <b>Col 2</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-3">
      <b>Col 3</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-4">
      <b>Col 4</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="item item-5">
      <b>Col 5</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type sp
    </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

Styling an unordered list with CSS in HTML is a powerful

I am working with an unordered list where each list element contains two spans: span A and span B. My goal is to style these elements so that they are displayed horizontally on the screen, with span A above span B in each set. Example: spanAItem1 sp ...

What is the best way to position an arrow in relation to a circle?

I'm struggling to center the arrow in relation to the circle How can I switch the arrow direction to point downwards when viewed on mobile, so that the images are stacked vertically with downward arrows? Here is the code snippet that I have experimen ...

How to specify columns when storing data in a CSV file using Scrapy

As I scrape data from the web, I am facing an issue with my csv file where the links column is always displayed as the first column. How can I specify the placement of columns in the csv file? pName = response.css('#search .a-size-medium') ...

Unique events catered to specific devices: mobile vs. desktop

When a user clicks on the login icon from a desktop, I want a modal dialog to appear. However, when using smaller devices like mobile or tablets, I prefer that a reactjs route is triggered to display in the main content area instead of using a modal dialog ...

Learn how to incorporate a HTML page into a DIV by selecting an Li element within a menu using the command 'include('menu.html')'

I have a website with both 'guest' and 'user' content. To handle the different menus for logged-in and logged-out users, I created menuIn.html and menuOut.html files. These menus are included in my MainPage.php using PHP logic as sugges ...

What is the best way to resize a Bootstrap 4 form to perfectly fit the screen width in mobile view?

I need help with a Bootstrap 4 form that I want to adjust to fit the viewport of mobile users. Currently, mobile users see this: https://i.sstatic.net/JjRa8.png The form inputs do not fill the width of the screen, and I want them to take up the full wid ...

Ensuring that the text input is perfectly lined up with the submit button

Is there a way to solve this discrepancy? Solution: https://jsfiddle.net/6q352ysx/59/ The elements are currently the same height, but not aligned properly. https://i.stack.imgur.com/ajVyJ.png Which alignment option should I use? Option 1: vertical-ali ...

HTML: attempting to align a quote image next to some text within the page

I want to add a quote to my website, but I'm having trouble positioning it correctly. https://example.com/quote-image.png Every time I try to adjust the position of the quote image, it moves when I zoom out. https://example.com/background.png I attem ...

Failure occurs when attempting to utilize external .js and .css files

As I embark on creating a website using Bootstrap, I stumbled upon a registration page code that consists of three files - HTML, CSS, and .js. registration.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> ...

Switch between input and the input is not displayed inline

I've been struggling to align the Toggle button with the input box for quite some time now. I really need them to be inline so that they form a grid properly as everything is dynamic. I have experimented with using a Div on its own instead of a label ...

Bootstrap 4 does not have the capability to include spacing between two columns

I'm encountering an issue with adding a gutter between 2 columns on my website layout. I have a row that needs to be 1280px wide (based on a reference resolution of 1366x768 with padding of 43px on each side of the page), containing two sections that ...

Ways to create a responsive Instagram iframe without using JavaScript

Currently, I am attempting to create a responsive grid featuring Instagram posts. Unfortunately, the padding-bottom hack isn't effective for my particular situation. After some experimentation, I discovered that the height could be calculated by addin ...

Tips for incorporating Javascript in an innerHTML inline css situation

I'm just starting to learn about html5 and php. I'm curious about how to incorporate javascript into my existing code. Currently, I have data from a database displayed in an HTML table. My goal is to align the output of the last cell more toward ...

Using jQuery, generate a div element and display it in full screen mode

Is it possible to dynamically create a full-screen div using jQuery directly from JavaScript without the need to first define it in the HTML and then make it visible with jQuery or CSS? UPDATE After some troubleshooting, I found a solution to my issue: ...

Trouble arises when trying to override base theme values in Mui 5 with styled components

Having trouble with Mui5 and SC when trying to override base theme values. The base theme for Mui components looks like this: const theme = createTheme({ components: { MuiButton: { styleOverrides: { root: { borderRadius: "1. ...

Transforming the color of a globe from black to white with gio js

After searching for a solution to change the color of a Three.js globe, I came across a link that didn't work as expected: Change the color of a Three.js globe. My goal is to change the globe color from black to white using . I attempted to use the f ...

What is the best way to apply a background image to a DIV element using CSS

The main aim is to change the background image of a DIV using AJAX. $.getJSON("https://itunes.apple.com/search?term=" + searchTerm + '&limit=1' + '&callback=?', function(data) { $.each(data.results, fun ...

Animation of underline on hover for NavLink

As a newcomer to React, I am currently exploring how to create an animated underline effect when hovering over a NavLink from reactstrap. I have managed to get the underline working on hover thanks to the solution provided at , but I am struggling with imp ...

Mysterious obsidian container lurking in the background of the video on Chrome version 67.0.3396

Displayed on the page is an HTML Video tag, which streams a video from the speaker (WebRTC). <div id="remoteVideoContainer"> <video id="remotevideo" autoplay="autoplay" controls="" loop="loop" preload="true" height="500" width="100%"> ...

Enhancing PHP Markdown to Support Custom CSS Classes

Markdown is a tool I use frequently in my PHP projects, but sometimes I find its output to be too simplistic. I wish I had more control over the layout and design of my content. For example, when inserting an image: <p> <img src="path/to/image. ...