Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:14:01+00:00 2026-06-04T00:14:01+00:00

Can flexboxes be nested? I have nested a horizontal flexbox in a horizontal flexbox,

  • 0

Can flexboxes be nested? I have nested a horizontal flexbox in a horizontal flexbox, and a vertical flexbox in a vertical flexbox. Only the horizontal in horizontal works in chrome and neither work in firefox!

I have created a jsfiddle here: http://jsfiddle.net/NpkTL/1/

But here is the html:

<div id="A">
    <div id="A1">A1</div>
    <div id="A2">
        <div id="A2-container">
            <div id="A2a">A2a</div>
            <div id="A2b">A2b</div>
        </div>
    </div>
</div>
<div id="B">
    <div id="B1">B1</div>
    <div id="B2">
        <div id="B2-container">
            <div id="B2a">B2a</div>
            <div id="B2b">B2b</div>
        </div>
    </div>
</div>

​
and the CSS:

* {
    margin: 0;
    padding: 0;
    font-family: Arial;        
}

#A {
    position: absolute;
    top: 0px;
    left: 0px;
    background: black;
    width: 50%;
    height: 100%;

    display: -moz-box;
    display: -webkit-box;    
    display: box;
    -moz-box-orient: horizontal;
    -webkit-box-orient: horizontal;
    box-orient: horizontal;
}

#A1 {
background: brown;
width: 100px;
height: 80%;   
}

#A2 {
background: orange;
height: 80%;
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;    
}

#A2-container {
    display: -moz-box;
    display: -webkit-box;    
    display: box;
    -moz-box-orient: horizontal;
    -webkit-box-orient: horizontal;
    box-orient: horizontal;
    width: 100%;
    height: 100%;    
}

#A2a {
    background: red;
    height: 80%;   
    -moz-box-flex: 1;
    -webkit-box-flex: 1;
    box-flex: 1;    
}

#A2b {
    background: blue;
    width: 100px;
    height: 80%;
}

#B {
    position: absolute;
    top: 0px;
    right: 0px;
    background: gray;
    width: 50%;
    height: 100%;

    display: -moz-box;
    display: -webkit-box;    
    display: box;
    -moz-box-orient: vertical;
    -webkit-box-orient: vertical;
    box-orient: vertical;

}

#B1 {
    background: brown;
    width: 80%;
    height: 100px;   
}

#B2 {
    background: orange;
    width: 80%;
    -moz-box-flex: 1;
    -webkit-box-flex: 1;
    box-flex: 1;    
}

#B2-container {
    display: -moz-box;
    display: -webkit-box;    
    display: box;
    -moz-box-orient: vertical;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    width: 100%;
    height: 100%;    
}

#B2a {
    background: red;
    width: 80%;   
    -moz-box-flex: 1;
    -webkit-box-flex: 1;
    box-flex: 1;    
}

#B2b {
    background: blue;
    width: 80%;
    height: 100px;
}

​#A is on the left, #B is on the right. #A and #A2-container are vertical flexboxes and #B and #B2-container are horizontal flexboxes. I set colors for the different divs and shrank them at each level (width for vertical and height for vertical) to make it easier to see what’s going on. It looks fine on the left (in chrome!), but on the right, #B2a should vertically fill #B2 (the orange one).

I realize that in this example it would be easier to use one flexbox with the flex in the middle row/column of 3, but I am dynamically loading the content into the equivalent of #A2, which happens to also be a flexbox.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:14:05+00:00Added an answer on June 4, 2026 at 12:14 am

    Firefox’s flex box model is pretty buggy right now. If you have any boxes with fixed or absolute positioning, it’ll break; also not having a width will revert your flexboxes to inline-boxes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone provide the XAML for creating customized check boxes. I have attached the
Can PHP PDO extension bind nested objects automatically ? I mean using foreign key
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Can't figure out how to do this in a pretty way : I have
Can a LINQ enabled app run on a machine that only has the .NET
I am using the Flexbox jQuery control. I want to configure it to only
Can some one Guide me to work with these things... What is Model popup
can anyone tell me why this doesn't work? db = openOrCreateDatabase(database.db, SQLiteDatabase.CREATE_IF_NECESSARY, null); db.setLocale(Locale.getDefault());
Can't work out a way to make an array of buttons in android. This
Can you have submenus with the top level set to checkable in WPF? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.