I am looking to achieve the layout shown in this image using flexbox:
The image illustrates both portrait and landscape orientations. The left side represents the portrait view while the right side displays the landscape view.
My goal is to optimize my HTML to be as concise as possible. Is it feasible to accomplish this layout with flex?
For the portrait view, everything is functioning seamlessly since it consists of just one column.
However, I have encountered a hurdle when transitioning to the landscape orientation.
In this scenario, I aim for the navigation to be positioned on the right side of the screen while the remaining content is displayed on the left.
header, footer, main, nav {
margin: 5px;
padding: 5px;
border-radius: 5px;
min-height: 120px;
border: 1px solid #eebb55;
background: #ffeebb;
}
section {
display: flex;
flex-direction: column;
}
@media only screen and (orientation: landscape) {
/* Currently uncertain */
}
<section>
<header>header</header>
<main>content</main>
<nav>navigation</nav>
<footer>footer</footer>
</section>
Thank you sincerely for your assistance!