0

I'm designing a basic layout using flexbox.

enter image description here

I've tried the following code but it's not working:

<div id="wrapper">
    <div id="container">
        <div id="div1">1</div>
        <div id="div2">2</div>
    </div>
    <div id="div3"></div
</div>

#wrapper {display:flex;flex-direction:row;}
#div1, #div2 {display:block;}
#container, #div3 {flex:1};

The code can be changed as needed.

1 Answer 1

1

You can use yor #container as a vertical flexible container, so you can share the height between #div1 and #div2.

#wrapper {
  display: flex;
  width: 200px;
  height: 200px;
  border: 1px solid black;
}
#container,
#div1,
#div2,
#div3 {
  flex: 1
}
#container {
  display: flex;
  flex-direction: column;
  border-right: 1px solid black;
}
#div2 {
  border-top: 1px solid black;
}
<div id="wrapper">
    <div id="container">
        <div id="div1"> div 1</div>
        <div id="div2"> div 2</div>
    </div>
    <div id="div3"> div 3</div
</div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.