0

i'm having for example 3 divs next to each other,covering all available width in the browser like this

enter image description here

and i want them to stay like this when the window is resized or zoomed in/out

enter image description here

where should i start ?

div {
  position: relative;
  float: left;
  border: 1px solid black;
  width: 100px;
  height: 50px;
  margin: 2px;
}
<div></div>
<div></div>
<div></div>
Vaggelis
  • 912
  • 5
  • 17

1 Answers1

-1

you should add overflow property to parent div like below:

.parent{

overflow:auto; }

sid
  • 1
  • 1
  • in the snippet the parent is the body which has this property by default. Non-theless it remains a terrible solution as it is unresponsive and not does what the OP actually wants. flexbox or grid are the way to go. give the width of 1fr or 33.3% – tacoshy Mar 27 '21 at 10:56