Hello everyone, dear friends.

I have an interesting task ahead of me, I need to do adaptability, prescribe max-width for each individual container, and set max width:100% , I mean <div id="left"> and <div id="right"> each is divided CSS properties on display: table-cell , and if I use display:block then the whole container becomes not beautiful and not adaptive.

What do i do ?

  • one
    Code add? It will be easier. - Eugen Eray

2 answers 2

In the absence (at the moment) of the code in the question, you can only answer this:

To maintain adaptability when using display: table-cell , the parent element should have display: table .

    Take the time to learn "display: flexbox" and you will be surprised by its possibilities :)

     <div class="container"> <div>Div 1</div> <div>Div 2</div> </div> .container { border: 2px solid #ffffff; padding: 20px; display: flex; } .container > div { border: 1px solid black; background: #ececec; padding: 10px; margin-left: 10px; flex: 1; }