I wonder how can I set a div inside html body away with certain values whatever the width of the html body. Like below illustration :
There are two sidebars at each side. i want to create a div between them, respecting that the distance from sidebar 1 is 50px and the other is 20px . i want to keep this distance if the width of the html body always changing.
in other meaning .. I want to make this in-between div is always away from the other two sidebar, for example if the body width is 1000px so the width of the in-between div increase to match 50/20px distance, and if the width of the body become 500px, the div width decrease to respect the 50/20px
UPDATE 1
After i tried the solution provided by Mr.Roberto Zvjerković
for the parent div i applied the below :
.Existed-ne-data-div-main {
position: absolute;
display: flex;
background-color: #0069D9;
height: 100%;
width: 100%;
overflow-x: auto;
align-items: center;
}
in-between div :
.Existed-ne-data-div {
position: absolute;
display: block;
width: 100%;
height: 60px;
background-color: rgb(220, 228, 220);
min-width: 150px;
box-shadow: 0px 0px 9px rgb(2,3,3);
border-radius: 5px;
margin-left: 140px;
margin-right: 180px;
}
The Result :
so from left side it works, but right side is not.
UPDATE2
After removing position in child. solution is worked.