Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

Automatic image height [duplicate]

$
0
0

How do I make the height of the image become the height of the block if the height of the block is not known in advance?

I want to make the blocks with users look like:

AAA James BondAAA  02.01.2001

The "A" characters are an image that should adjust to the height of the text.

.employer {  display: flex;   gap: 10px; }.avatar {  height: 50px; /* It doesn't have to be hardcoded */  border-radius: 50%;}
<div class='employer'><img src="https://example.com/avatar.png" alt="" class='avatar' /><div class='info'><div>James Bond</div><div>02.01.2001</div></div></div>

Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>