DEV Community


Build conditional layouts with CSS Flexbox

hybrid_alex profile image Alex Carpenter ・1 min read

If you enjoyed this screencast, consider subscribing to my YouTube channel for more screencasts about HTML, CSS, and JavaScript.

Discussion (2)

Editor guide
jrock2004 profile image
John Costanzo

Another way you can do this with a little less CSS, is on the .main__content. Remove the width property and just have flex: 1. Now if the sidebar is hidden, it will just take up the room you wanted.

hybrid_alex profile image
Alex Carpenter Author

Definitely, you can see here that I make that recommendation