The reason for this behavior is tied to the structure of the HTML, which determines the arrangement of DOM (document object model) elements. How each element behaves can vary depending on its position in the order.
If you're seeking more clarity, you may find guidance from THIS FIDDLE. I coincidentally encountered a similar scenario during my own project.
Sample HTML Structure:
<header class="global-header">
Header
</header>
<div class="container">
<div class="column sidebar">
Sidebar content with fixed width
</div>
<div class="column page">
Main content with flexible width
</div>
</div> <!-- .container -->
Aspects of CSS Implementation:
html, body {
height: 100%;
margin: 0;
padding: 0;
}
.global-header {
width: 100%;
float: left;
padding: 1rem;
}
.container {
width: 100%;
float: left;
height: 100%;
overflow: hidden;
}
.column {
min-height: 100%;
padding: 1rem;
}
.page {
float: none; /* clarification */
background: #C0FFEE;
width: auto;
overflow: hidden;
}
.sidebar {
position: relative;
width: 20rem;
float: right;
background-color: #f06;
color: rgba(255,255,255,.8);
}