So i have the following in HTML:
and the blue rectangle occupies 70% of the width of the outer container and the green rectangle occupies 30% of the width of the outer container.
Now what I'm trying to achieve is that, when I set the green rectangle div to "display:none", I would want the blue rectangle div to fill up the remaining of the width of the outer div so i could get something like:
Right now, if i set the green rectangle div to display:none, i get the following:
Would appreciate some help on this.
html, body {
height: 100%;
}
#outer {
border: 1px solid black;
height: 20%;
width: 50%;
display:flex;
}
#inner_long {
width: 70%;
background-color: blue;
}
#inner_short {
width: 30%;
background-color: green;
/*display:none;*/
}
<!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 = "outer">
<div id = "inner_long">
</div>
<div id = "inner_short">
</div>
</div>
</body>
</html>