Hi does anyone know how to have a divs width depending on surrounding divs.
Currently, my problem section looks this:
But i would like it to look like this
I would like it to go there regardless of the screen size.
Currently, it looks like this if i shrink my screen:
So is there any way for it all to stay on the same line and just change the width of the progress bar so it always goes to the start of the next div.
#coinsdiv{
border-width: 2%;
border-style: black;
/*position: absolute;*/
float: right;
width: 70px;
height: 70px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 75px;
border-style: black;
background: gold;
margin-top: 2%;
margin-right: 3%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
/*clear: left;*/
/*display: inline-block;*/
}
#coinspan{
font-family: Arial;
font-size: 20pt;
float: center;
/*margin-top: auto;*/
}
#aroundcoin{
float: right;
margin-right: 3%;
margin-top: 2%;
width: 100%;
}
#progressbar {
width: 70%;
height: 5%;
background: red;
margin: 1%;
float: left;
}
#inrect{
width: 10%;
height: 100%;
background-color: blue;
}
#coinDescribe{
float: right;
}
<div id="aroundcoin">
<div id="progressbar"><div id="inrect"></div></div>
<div id="coinDescribe">Coins Earned:</div>
<div id="coinsDiv" ><span id="coinspan">ERR</span></div>
</div>
Sorry This is a little vague. Thanks, Hamish.