Despite trying various methods like using inline-block
and float
, the divs in my code continue to stack on top of each other.
What could be causing this issue?
#resources {
position: fixed;
top: 0;
left: 0;
z-index: 1;
display: block;
width: 4%;
background: rgba(0, 160, 255, 1);
color: white;
font-size: 1.5em;
padding: 0.5em;
border-radius: 10%;
}
#woodResource #stoneResource {
display: inline-block;
float: left;
}
<div id="resources">
<div id="woodResource">
<img src="/models/wood.png" id="wood"> 0
</div>
<div id="stoneResource">
<img src="/models/stone.png" id="stone"> 0
</div>
</div>
I have exhausted all possible solutions mentioned online such as using inline-block
and float
, but none seem to resolve the issue.