I want to add two divisions side by side, on one side I want to add the profile picture and on the other side I want to add the content like username, email etc. How can I achieve this in custom HTML and CSS?
Asked
Active
Viewed 54 times
-3
-
2Have you tried anything on your own? Read [How much research efforts are expected from SO users](https://meta.stackoverflow.com/a/261593/18254155) – Archit Gargi Jun 08 '22 at 17:16
-
2Welcome to SO! Please read [ask] and post a [mre] of the code you've attempted so we can better assist you! :) – AStombaugh Jun 08 '22 at 17:17
2 Answers
0
enter code here
.ava {
display: flex;
flex-direction: row;
justify-content: left;
align-items: center;
cursor: pointer;
}
img {width: 90px}
<div class="ava">
<div class="image"> <img src="https://img.freepik.com/free-vector/mysterious-mafia-man-smoking-cigarette_52683-34828.jpg?size=338&ext=jpg&ga=GA1.2.1744368405.1645544000" /> </div>
<div class="content"> Kite </div>
</div>
you can check this ->

Kite
- 19
- 3
-1
You can create a single div as a wrapper then inside that div you can use the two divs side by side. use the following code:
<div class="abc">
<div style="width: 100%;">
<div style="width: 20%; float: left;">Profile - Pic</div>
<div style="width: 80%; float: left;">Name : abc
Email : useremail
</div>
</div>
</div>

Syed Shuja Shah
- 22
- 6
-
1The div's will float, and therefor not best practice for a div structure. – bron Jun 08 '22 at 17:50