I am a newbie of html and css whereas tyring to practice a couple of things of formulating but my efforts getting into futile.
Please find the code below, and images for your kind reference to get to know your opinion.
.container {
display: block;
width: 200px;
height: 120px;
}
.picture {
width: 40px;
height: 40px;
border-radius: 50%;
display: inline-block;
}
.oliver {
display: inline-block;
margin-left: 0px;
font-weight: bold;
height: 20px;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
vertical-align: top;
width: 50px;
}
.popular {
font-size: 15px;
width: 50px;
height: 50px;
color: #666;
display: inline-block;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-top: 0px;
vertical-align: center;
}
.follow-button {
display: inline-block;
width: 90px;
height: 30px;
margin-top: 0px;
padding: 0px;
border: 1px solid #ccc;
border-radius: 9px;
background-color: #0f6fb0;
cursor: pointer;
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
color: white;
font: verdana;
}
.follow-div {
display: inline-block;
width: 20px;
margin-left: 0px;
margin-top: 8px;
margin-bottom: 0px;
padding: 0px;
vertical-align: top;
}
<div class="container">
<img class="picture" src="/Users/riyazmohamed/Desktop/HTML-CSS/Intro-to-html/channel-picture/cat.jpeg" alt="cat" />
<p class="oliver">oliver</p>
<p class="popular">the popular cat</p>
</div>
<div class="follow-div">
<button class="follow-button">Follow</button>
</div>
I want the content of "the papular of cat" to be under Oliver like under picture.
Please help me, thank you.
content need to be formulated under the olive, please help me to get it done per lateral picture given as sample.
2
Answers
Here is one of the possible solutions using Flexbox. Just wrap the image in one div, p tags are already block-level elements but I have wrapped them also in divs. After that use the display: flex on the .container and that’s it.
Here is the link Codepen
https://codebeautify.org/htmlviewer/y23360db5