After searching on SO, I couldn't find the same question anywhere.
.container {
display: flex;
justify-content: center;
}
.aside-left {
width: 200px;
}
<div class="container">
<aside class="aside-left">
menu1 menu2
</aside>
<div class="content">
pagesssssssssssss
</div>
<footer>
copyright
</footer>
</div>
Here are the requirements:
- The content div should always be centered in the window, regardless of the aside div
- When the window width is less than 991px, the aside should not be displayed
- It's preferable to use flex instead of float solution
first-item-on-center-and-second-item-at-last-in-flex may be relevant, but the aside tag still affects the content div
Currently, I know how to center the container, but I want to center the content div within the window and have the aside float left next to it. https://i.sstatic.net/CsPfb.png