Embracing the flexibility of flexbox nesting

Flexbox has been a game-changer for me, and I can't help but want to incorporate it into all my projects since I first started using it.

Curious Thought

I'm wondering if nesting flex-boxes is considered best practice. Could having numerous, especially nested ones, negatively affect performance?

Answer №1

A decrease in performance by about 10 times is to be expected, though the impact is minimal in terms of milliseconds.

Using a large number of them should be approached with caution as it can significantly slow down render speed from 10MS to 100MS, thus increasing overall render time.

Additionally, there may be compatibility issues with browsers and difficulties when working with absolute positioning and block elements.

For now, I suggest utilizing display:table for the parent and display:table-cell & display:table-row for the children.

Here is an example of my preferred approach:

.align-table {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.t-align {
  display: table-cell;
  vertical-align: top;
  width: 100%;
}

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

Whenever I adjust the zoom on my HTML page, it either scrolls upwards or downwards

Is there a way to prevent the page from scrolling when using zoom-in or zoom-out? I attempted using overflow: hidden in the body, but it did not work. <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

Implementing the sticky positioning property to keep a div container fixed at the bottom of the page

As Bootstrap 4 no longer supports .affix, I had to look for an alternative solution to keep a box fixed. I needed a div container to remain fixed as you scroll to it. My current workaround is using: .fixedcard{ position: sticky; top:75%; } However, th ...

"Trouble with Bootstrap 4 menu: only one dropdown opens at a time

I am facing an issue where the text remains a link and the dropdown toggle works, but it is causing Dropdown-2 to open when I click on Dropdown-1. Only Dropdown-1 seems to be working properly. I can't seem to figure out why only Dropdown-1 opens no m ...

Generate captivating background visuals with animated elements that evolve over time

I need help creating a dynamic background image that transitions smoothly every few seconds. The current code I have doesn't include animation, and the images are taking too long to load. Is there a way to optimize the loading time? Here's my ex ...

Transforming a fluid webpage into a fixed page

Currently, I am undertaking a project that involves converting a dynamic website like Adobe Spark into a static HTML+CSS page, which will eventually be transformed into a PDF. The interactivity of the website relies heavily on Javascript modifying CSS+HTML ...

What is the best way to increase the size of this text when an image is hovered over?

I'm looking to make the .thumb_text element grow when hovering over the <img> within the li.thumb_list. Currently, I can only achieve this effect when hovering over the text itself, not the image. In addition, the text is inexplicably becoming ...

What makes Swift lag behind C by 100 times in this particular image processing test?

Excitement was high among many developers, myself included, when Apple introduced the new Swift language. Apple claimed it was faster than Objective C and could be used for writing operating systems. The static typed nature of Swift allows for precise cont ...

Steps for designing a stationary footer in HTML and CSS

I have implemented a static footer on my website: HTML <div class="card fixedFooter"> <div class="card-body space-around"> <button type="button" class="buttonFooter" routerLink="/myRouter" > <i class ...

What could be causing the issue of node-sass generated CSS files not loading on the initial GET request?

I've set up a node express app and incorporated sass support for the CSS. However, when I attempt to access http://myhost.com:port/css/whatever.css, the whatever.css file is generated in the express_app_root/public/css directory as expected. The *.scs ...

I am having trouble setting margins for a sticky position in a WordPress website

Can someone help me reposition the left-sidebar with a sticky top to be below the main header when scrolling down? Adding margin-top to sticky-top under col-sm-1 is not working. <style> .col-sm-1 .sticky-top { margin-top: 50px} </style> ...

Display a custom dropdown menu depending on the value chosen from a separate dropdown menu

There are three dropdown lists, each enclosed in its own DIV container. The DIV containers are named fromCity, WithinStateLimits, and OutOfState. The goal is to use the jQuery script below to hide the other two DIVs when a user selects an option from the ...

Identifying rectangular shapes in an image and overlaying a div on top using Jquery

I am currently exploring the possibility of achieving the following: Imagine having an image within a div (serving as the background image). This image resembles an Excel sheet. My goal is to generate an input tag or contenteditable div when a user clicks ...

What obstacles must be overcome when developing a CSS framework?

Currently, I am delving into the realm of popular CSS frameworks such as Bootstrap and Foundation. While studying them, I have identified aspects that I believe could be enhanced and customized to suit my own projects or potentially for free distribution i ...

What is quicker: loading SVG images or requesting sprite images?

Is there a recommended approach for creating a basic shape and icon that is used in various sections of the website with different colors? Should I opt for SVG or sprites? However, I wonder if there is a universally accepted solution for this issue. ...

Nested navigation in Bootstrap

I am currently working on creating a multilevel menu using Twitter Bootstrap. Check out the code here Below is the snippet of HTML code: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ...

Issue with Element Height Rendering in Chrome

I'm having trouble adjusting the height of the Div in this theme to 156px. It seems to be inheriting a CSS property from another source which is setting it to 118px instead. Please visit the following website in Chrome and Firefox to see the differe ...

Implement a CSS design for the flash notification

My application is built with Sinatra. I have implemented the sinatra-flash gem to display flash messages if the user fails to select enough items for comparison. While this functionality is working fine, I am having difficulty customizing the styling of th ...

Tips for altering the label color of an md-input-container after text has been entered

Is there a way to dynamically change the color of an md-input-container label after certain input is added? The default grey color gives the impression that the field is disabled. I specifically want to modify the color of the label "Description" when the ...

Setting up custom CSS with bokeh serve is a straightforward process that can enhance the

Is it possible to assign custom CSS properties to a class that has been assigned to a widget using the css_classes parameter when serving the app with bokeh serve --show? from bokeh.models import Button button = Button(label="Press Me", css_classes=[&apos ...

Add a custom filter to the active route for a stylish look

I am trying to dynamically change the color of elements in my navbar by creating a filter in my typescript code. I have a string with values like 'greyscale(73%) saturate(1400%)'. How can I apply this string to the fa-icon's filter property ...