As a beginner in learning CSS, I am seeking guidance and insights. I am aiming to achieve a layout similar to the one shown in Pic1.
https://i.sstatic.net/Mmfpw.png
Below is the HTML & CSS code I have attempted:
.header {
background-color: yellow;
display: flex;
}
.left {
display: flex;
background-color: coral;
}
.right {
background-color: aqua;
display: flex;
justify-content: space-between;
}
<div class="header">
<div class="left">
<p>Left</p>
</div>
<div class="right">
<div class="right-1">
<p>Right-1</p>
</div>
<div class="right-2">
<p>Right-2</p>
</div>
</div>
</div>
This is what I have achieved with the code above:
https://i.sstatic.net/acbvC.png
I can successfully align two divs (e.g., left and right) in a row without nesting them. However, when I remove 'display: flex' from '.header', 'Right-1' and 'Right-2' stack on top of each other while still maintaining the space between them. Here is the result after removing 'display: flex' from '.header':
https://i.sstatic.net/iEsLz.png
Your assistance is greatly appreciated as I aim to achieve a layout with three flex items in a single row - one fixed and two spaced apart.