I have such html and css code. I have two questions:
- When the window width is 600px, in theory, the left box should be of 150px width, because it's the 25% of the parent(600px), but the width is 120px.
- The right box can not reach 100vw. It just takes the
widthOfParent
-widthOfLeft
. I suppose it should somehow overflow and reach 100vw.
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
* {
margin: 0;
padding: 0;
}
.container {
height: 300px;
/* your code here */
display: flex;
justify-content: start;
}
.left {
background-color: #f44336;
height: 100%;
width: 25%;
min-width: 100px;
}
.right {
background-color: #2973af;
height: 100%;
width: 100vw;
}
codesanbox: https://codesandbox.io/s/admiring-darkness-cu99x?file=/src/styles.css:0-293