Search code examples
htmlcssoverflow

overflow-x div child width


I'm trying to find a solution for this case:

I have a div container with a static width and overflow-x: auto; 2 child divs, one of them has fixed width, the other one doesn't.

How can I make div without width to have same width as parent?

Here's an example:

http://jsfiddle.net/no1lov3sme/U7PhY/1827/


Solution

  • I found the solution in 2022 🙂

    #parent {
        display: grid;
    }