Achieve full height for nested children within a container of varying height without using flexbox

Inside a container of variable height, I have multiple nested lists that I want to take up all the available space.

I attempted to use flexbox for this purpose, but performance issues arose in Chrome, FF, and Safari when dynamically adding more nested lists (perhaps due to reflows). Therefore, flexbox is not a viable solution in this scenario. Using table and table-cell also did not yield the desired result.

Here is a basic example: https://jsfiddle.net/bf0f6zj5/

The HTML structure:

<ul>
  <li>
    <div>
      text 1
    </div>
    <ul>
      <li>
        <div>
          some very long text here
        </div>
        <ul>
          <li>
            <div>
              text 3
            </div>
            <ul>
              <li>text</li>
              <li>text</li>
              <li>text</li>
              <li>text</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

The CSS styling:

ul, li {
  margin:0;
  padding:0;
  list-style-type: none;
  overflow:hidden;
}

li {
  border-left: 1px solid grey;
  padding-left: 8px;
}

li > div {
  padding-right: 4px;
  float:left;
  writing-mode: vertical-rl;
}

The objective is to ensure that the left borders of all nested lists are equal in height to the tallest one, without relying on flexbox.

Edit: For demonstration purposes, another fiddle is available at https://jsfiddle.net/vgjkzhqq/3/ showcasing the performance challenges with flexbox (takes over 2000ms to render)

Edit 2: Updated link provided

Answer №1

Various sources, including Google Web developers, have dispelled the myth that Flexbox causes performance issues:

In Short

Flexbox is generally faster than older display properties. According to Paul:

Old flexbox (display: box) is 2.3x slower than new flexbox (display: flex)

I trust this information proves helpful :)

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

Utilize jQuery Function on Identical Class of <ul> Elements

I have integrated a listview control in my ASPX page. The data is being fetched from the database and displayed in the listview. I have also utilized jQuery script to implement the .fadein() and .fadeout() effects on the listview elements. However, when I ...

What is the best way to trigger an event function again once a specific condition has been satisfied?

I'm currently working on a project where I need a sidebar to scroll at a slower rate until it reaches a specific point, and then stop scrolling once that point is reached. Below is the jQuery code I've been using: $(window).on("scroll", function ...

What is the best way to eliminate the excess space below the footer on a vuejs page?

I am developing a footer using vuejs along with buefy. In my implementation of App.vue below, I am encountering a white margin under the footer. // App.vue <template> <div id="app"> <main-header /> <router-view/ ...

Achieving equal height columns in Bootstrap - text alignment within rows

Is there a method to make the heights of a text and image column equal? I am looking for a way to align the height of the text section with the image section. This adjustment would result in the picture being displayed cropped or shortened. .row-eq-hei ...

A step-by-step guide on crafting a triangular-shaped div connected to another div

After working with HTML elements and trying to incorporate 2 divs, I realized that I couldn't achieve the triangle-shaped div that I actually needed. I have included an image for reference. Below is the HTML code snippet: <div style="background-c ...

Aligning Content in the Middle of a Bootstrap Column

Can anyone help me with centering the content of a bootstrap column vertically? I'm facing an issue when setting width: 100% and height: 100% for the overlay div. Any solutions? Here is an example image of what I am trying to achieve: https://i.ssta ...

Animating CSS Pixel Fragments

After applying a simple CSS animation that moves size and box shadows from one side of the screen to the other, I am noticing residual pixel fragments left behind. To see this issue in action on Chrome 66, check out the Code Pen: https://i.sstatic.net/Gl ...

How can you showcase search results on a single page URL in PHP by simply clicking a submit button?

insert image description here Hello Everyone, I am facing a particular issue: Within the url "/media.php?module=riwayat&noreg=00020517" All data with 'noreg = 00020517' appears. I aim to refine the displayed data using the 'keywor ...

Alter the color scheme of Fancybox's background

I am looking to create a transparent background color for Fancybox. The typical method involves using ".fancybox-skin" in CSS, however this will affect all fancyboxes and I require it to be unique. Therefore, the setting must be sent with wrapCSS. Fancyb ...

"Substitute the dropdown arrow in the select menu with a font awesome

I am currently facing a challenge in my project where I need to customize the select dropdown arrow by replacing it with a FontAwesome icon (specifically chevron-circle-down). While I have found resources on how to replace the background of the dropdown ...

Ensure that the height of the flex body is set to 100% within the ReactNative View

Within my React Native app, I have constructed the following view: <ScrollView style={{ width: 250, height: '100%', backgroundColor: '#000000' }}> <SafeAreaView style={{ flex: 1, flexW ...

Firefox is having trouble keeping <select> tags within their designated borders

I am currently developing a mobile app that requires the use of 3 <select> elements stacked on top of each other. It is crucial for these tags to align perfectly with each other and not extend beyond the boundaries of the background div. I have manag ...

Generate a Selectpicker dynamically when a button is clicked

Wanting to insert a new row in an HTML table dynamically by clicking on an add button. The new row includes a select element with the selectpicker class. Interestingly, when I remove the selectpicker class in my script to append a new row, the select eleme ...

Are You Able to Develop a Floating Window That Stays Persistent in JavaScript?

Looking to create a persistent floating window in a NextJS 14 app. This window needs to remain on top, even when navigating between browser windows. Want it to stay visible even when the browser window is minimized, like a Picture-In-Picture feature. Mos ...

Trouble with Bootstrap card dimensions: Height and width not functioning correctly

I specified a height and width for all card images, but the heights are inconsistent with one being too large and another too small. I want each card to have the same height and width. How can I achieve this? Here is what I tried. .card { height: 50%; ...

What is the best way to align elements in a div or navigation section?

Behold, my masterpiece navigation bar: #main-nav-bar .nav-item { display: inline-block; padding: 0.5%; border-right: 1px solid white; } #main-nav-bar a { text-decoration: none; color: #CFCFE0; } <nav id="main-nav-bar"> <a href="#Ser ...

Dropdown sidebar with collapsible sections

I am looking to create a unique navigation system for my website. I have a standard HTML list with menu items that will serve as anchor links on a long-scrolling page. My idea is to design it as a minimal vertical side navigation bar, where each item initi ...

Move anchor tags within HTML content produced from Markdown using Jekyll

I am facing an issue with the navigation bar on a website I am currently developing. The fixed navigation bar at the top is causing some alignment problems with anchor tags. While I know about the common solution to this issue, I am unsure of how to implem ...

Differences in performance between Angular and JQuery_execution times

I am facing an issue on my dynamically populated Angular page. Angular sends a request to the backend using $http.get to retrieve data which then populates attributes of a controller. For example, when I call $http.get('/_car_data'), the JSON re ...

The width of table cells expands even when using the box-sizing property set to border-box

Whenever I click the View button, I want to apply padding to the cells in my table. However, this action also increases the width of the cell. Despite researching various solutions like those found in this question, this one, and this post, I still encount ...