I'm struggling to grasp the concept of how divs function in HTML. Below is a snippet of my HTML code:
<div id="user_p">
<img src="img/pp/djbaptou.jpg">
<div class="followings"> djbaptou </br> Baptiste Arnaud </br> Description: Salut j'aime les carottes lol
<a href="#">Modifier profil</a>
</div>
<div class="followings"> Suivi de: </br> 200 </br> personnes</div>
<div class="followings"> Suivi par: </br> 300 </br> personnes</div>
</div>
Additionally, here is the corresponding CSS stylesheet:
#user_p{
background-color: red;
width: 60%;
height: 200px;
margin: auto;
}
#user_p img{
display: inline-block;
width: 200px;
height: 200px;
}
.followings{
font-family: "Roboto-Light", Helvetica, Arial, sans-serif;
width: 200px;
display: inline-block;
background-color: green;
margin-left: 60px;
text-align: center;
}
How can I achieve a display like this?
https://i.stack.imgur.com/vQO3L.jpg
I want to center my green divs.
When resizing the window, it looks like this:
https://i.stack.imgur.com/oYadT.jpg
I just need the green divs to remain within the red one...
Any ideas?