Only Chrome supports the combination of Flexbox and overflow:hidden

My left sidebar's content is not following the overflow:hidden rule in browsers other than Chrome. Instead of being limited to 300 pixels of the .container div, it extends in Firefox, IE, and Edge. Any ideas on how to fix this issue?

Check out this link for more details.

Answer №1

Consider making the following adjustment:

.flex-fill {
    display:flex;
    min-height: 0;
    flex:1 1 0%;
}

instead of

.flex-fill {
    display:flex;
    flex:1 1 auto;
}

This change addresses a couple of issues that may be causing the problem:

Firstly, IE does not recognize unitless flex-basis. For this reason, using flex: 1 1 0% or flex: 1 1 0px is necessary instead of flex: 1 1 0. Additionally, flex: 1 1 auto does not work in this situation.

Secondly, there are discrepancies in how Chrome and Firefox interpret display: flex. Firefox sets

min-height: auto; min-width: auto;
by default on display: flex elements, while Chrome sets it as min-height: 0; min-width: 0. The desired behavior aligns more with Chrome's interpretation.

This simple adjustment may not resolve all issues, but it appeared to function correctly when tested on IE and Firefox. If further problems persist, consider implementing similar changes in other classes based on the explanations provided. Hopefully, this solution proves helpful!

Answer №2

Your code has been modified with a few changes:

<div class="container">
    <div class="flex-col flex-fill">
        <div class="flex-row flex-fill">
            <div class="flex-col flex-50 dragscroll default-box" style="margin-right:5px;">
                <div class="button selected">1</div>
                <div class="button">2</div>
                <div class="button selected">3</div>
                <div class="button">4</div>
                <div class="button">5</div>
                <div class="button selected">6</div>
                <div class="button selected">7</div>
                <div class="button">8</div>
                <div class="button">9</div>
                <div class="button">10</div>
            </div>

            <div class="flex-fill default-box">
                center
            </div>

            <div class="flex-250 default-box" style="margin-left:5px;">
                side
            </div>
        </div>

        <div class="default-box flex-50" style="margin-top:5px;">
            bottom
        </div>
    </div>
</div>

.container {
    width:500px;
    height:300px;
    display:flex;
    flex-flow:column;
    background:lightblue;
}

.buttons-container {
    min-height:1px;
    height:100%;
    flex:0 1 50px;
    border:1px solid #CCC;
    background:#FFF;
    margin-right:5px;
    overflow:hidden;
    display:flex;
    flex-flow:column;
}

.flex-col {
    display:flex;
    flex-flow:column;
    overflow:hidden;
}

.flex-row {
    display:flex;
    flex-flow:row;
    overflow:hidden;
}

.flex-fill {
    display:flex;
    flex:1 1 auto;
}

.flex-50 {
    display:flex;
    flex:0 0 50px;
}

.flex-250 {
    display:flex;
    flex:0 0 250px;
}

.default-box {
    background:#FFF;
    border:1px solid #CCC;
}

.plot-area {
    display:block;
    position:relative;
    flex:1 1 auto;
    background:#FFF;
    border:1px solid #CCC;
    box-shadow:1px 1px 4px rgba(0,0,0,0.1);
}

.button {
    background:#cfeceb;
    vertical-align:middle;
    margin-bottom:5px;
    text-align:center;
    color:#56b6b2;
    cursor:pointer;
    font-size:26px;
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:50px;
}

.button.selected {
    background:#56b6b2;
    color:#FFF;
}

.button:last-child {
    margin:0 !important;
}

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

Tips for creating an empty column in each succeeding row of a grid layout

Is there a way to create a grid layout with divs that leave space on the left side of each subsequent row? For example, having 4 div boxes in the first row, 3 in the second, 2 in the third, and so on. Demo https://i.sstatic.net/Gli6L.png Styling in CSS ...

Unable to access content in the mail body of Outlook webmail via mailto

I have successfully created a mailto URL for Outlook (web version), but now I am facing challenges with implementing it on the web version OWA. Here is the URL that I am struggling with: <a href='https://company.domain.com/owa/?ae=Item&a=New& ...

Display scrollable content at the bottom

I am currently working on creating a chat application using JavaScript (AngularJS without jQuery) and I am wondering if it is possible to have a scrollable div load to the bottom automatically. While I am familiar with the scrollTo JS property, I do not f ...

JavaScript and CSS animations offer dynamic and engaging ways to bring

I'm working on a div section and I want it to come down and rotate when a button is clicked. However, after moving to the bottom, it doesn't rotate as expected but instead returns to its initial position along the Y axis. How can I fix this issue ...

Setting the maximum height for a tr or td element that is compatible with Chrome

Is there a way to set the max-height for a tr or td element that is specifically supported in Chrome? Previously, an answer suggested at this link did not work for Chrome: How to fix height of TR? ...

Grow the Bootstrap column when hovered over (Similar to Netflix)

My grid view is structured as follows: jQuery(window).resize(function(evt) { jQuery(".grid-content > div > div > .channelImage").height(jQuery(".grid-content > div > ...

Express handlebars does not support client-side javascript

This is a unique template <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>My Amazing Website</title> ...

Upgrading from Vuetify 2 to 3 involves replacing the deprecated styles like .v-application, rounded, and flat with

I need help with upgrading from Vuetify/Vue 2 to Vue 3. I don't have much experience in front-end development, but I am responsible for updating some old code to keep things running smoothly. The migration guide is not very clear and assumes a certain ...

Sending data to an Express server in Node.js using JavaScript

My current project involves the use of javascript, html, nodejs, express, and mysql to fetch values from a database and send them back to the html interface. In this setup, the user inputs a domain in the 'btnSearch' textbox and clicks on the Lo ...

The alignment of the container (heading) does not match that of the row (form) in Bootstrap 5

As mentioned in the title, I am looking to ensure that the rows have the same spacing as the container. I am currently using Bootstrap 5, so when you preview the HTML on Stack Overflow, it may not appear exactly as intended. To provide a clearer understand ...

Example of Utilizing Google Places API

The Issue I've been struggling to make this google maps API example function correctly. Even after directly copying the code from Google's website, the example fails to display properly. For instance, the map doesn't show up, the search bar ...

An error occurs when attempting to assign a value to a MUI file TextField

Struggling with setting the value of a MUI Textfield that has type="file" props, resulting in the following exception being thrown: Uncaught DOMException: An attempt was made to use an object that is not, or is no longer, usable Interest ...

Experiencing an issue with referrer: The global symbol needs an explicit package name

my $refer = $ENV{HTTP_REFERER}; my $gk1 = substr($str1, -4); if ($gk1 = .swf) { my $antigk = "gk detected"; } else { my $antigk = $link; } I am encountering issues with this code after making some modifications. What could be causing the errors? I ...

Controlling the Sequence of HTML Rendering in ASP.NET MVC

I have a pretty simple website setup. On the left side, I have a tree menu (using the Telerik component), and when a choice is made from the tree, the main content of the page is populated with static HTML content. Each tree click triggers a full page relo ...

Developing a logic for a Tagging System in PHP and MySQL

As a novice developer, I am seeking advice on my current project. I am in the process of creating a platform where users can upload images and tag them. After researching various methods of storing tags, I came across the following structure: Tag Storag ...

When the mouse hovers over a CSS positioned absolute div, it will be displayed on

I am currently working with an HTML table and my goal is simple. I want to create a menu that opens when the mouse hovers over it, but within a table. When I hover my mouse over the <span>Telephone:</span> element, I want the <div class="se ...

Issue with displaying the file-field in Django admin after upgrading from Django 2.1 to version 3

Since upgrading from Django 2.1 to 3, the file field in Django admin is now displaying as "loading". https://i.sstatic.net/8JDWu.png An error is appearing in the console. https://i.sstatic.net/RCgwt.png https://i.sstatic.net/78YtG.png Previously, ther ...

Issues arising from data representation on the user interface using AngularJS

Below is a JSON sample containing 2 objects that I am fetching: [{"project_id":"538","proyecto":"Caja","tarea":"DEF","fecha_termino":"00-00-00","estado":"Vencido","nombre_completo":"Christiano Ronaldo","alerta":"-Analista responsable: Lionel Messi.; &bsol ...

Is the .html page cached and accessible offline if not included in the service-worker.js file?

During the development of my PWA, I encountered an unexpected behavior with caching. I included a test .html page for testing purposes that was not supposed to be cached in the sw.js folder. Additionally, I added some external links for testing. However, w ...

A CSS hack for showcasing numerous div elements

I am looking to divide my window into two equal parts, with the same height but each taking up 50% of the width. Here is the CSS I used: .container { display: flex; height : 100%; } .column { flex: 1; height : 100%; } .column-one ...