79687002

Date: 2025-07-02 07:32:34
Score: 3.5
Natty:
Report link

@a-haworth's suggestion to use border-box was great, but for reasons I don't quite understand yet, it didn't work on it's own. Instead, I had to switch from using flex: 1 & flex: 3 to get my sizing ratio to instead use flex: 1 1 25% and flex: 1 1 75%. The auto flex basis seems to have been problematic? Not quite sure.

body {
  min-height: 100vh;
  margin: 0;
  
  /* Just for testing */
  width: 760px;
}

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  flex: 1 1 25%;
  
  /* All Good! */
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  max-width: calc(200px);

  background-color: lightsteelblue;
}

main {
  flex: 1 1 75%;
  
  padding: 0.5rem 1rem;
}
<div class="container">
  <aside class="sidebar">Sidebar Content</aside>
  <main>Main Content</main>
</div>

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • User mentioned (1): @a-haworth's
  • Self-answer (0.5):
  • Looks like a comment (1):
Posted by: Devildude4427