In my html page, I have two divs inside the div container. The two inner divs have a "position: aboslute". Of course, they should be placed in the lower left corner of the div container.
This works fine when the div container has only one inner div. But when I add the 2nd div, the second div is placed on top of the first inner div. It makes sense. But now I'm trying to find a way so that they are next to each other instead of overlapping each other.
Internal divs are created. Therefore, I cannot manually add IDs to them. All they have is one class name.
An example :
<div id="container">
<div class="icon">ICON1</div>
<div class="icon">ICON2</div>
</div>
#container {
position: relative;
width: 200px;
height: 200px;
border: 1px solid red;
}
.icon {
position: absolute;
bottom: 0;
left: 0;
border: 1px solid green;
}
Does anyone know how to solve this?
source
share