So I have the following in my page:
and they're basically two divs side by side coloured blue and orange which is made by making the outer container a flexbox.
What i want to do now is to prevent it from flexing vertically meaning if i adjust the height of the browser window, I want to prevent this:
as shown, they are becoming thinner height wise when adjusting the height of browser. How do i prevent this? Instead I want them to retain their height but just brings up a scroll bar at the side so it is scrollable height wise.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
height: 100%;
font-size: 1vw;
}
body {
height: 100%;
}
#container {
display: flex;
width: 100%;
}
#box1 {
border: 1px solid black;
width: 50%;
height: 90vh;
background: lightblue;
}
#box2 {
border: 1px solid black;
width: 50%;
height: 90vh;
background: orange;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href = "style.css">
<title>Document</title>
</head>
<body>
<div id = "container">
<div id = "box1"></div>
<div id = "box2"></div>
</div>
</body>
</html>
See Question&Answers more detail:os