Media Object Layout
CSS
Medium
3 views
Problem Description
Create an avatar + text layout using flexbox (image left, text right).
Output Format
Print the HTML+CSS code in one block.
Constraints
Use display flex and keep image size fixed.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
.item { display: flex; gap: 12px; align-items: center; border: 1px solid #eee; border-radius: 14px; padding: 12px; width: 380px; }
img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
</style>
</head>
<body>
<div class='item'>
<img src='user.jpg' alt='User'>
<div>
<strong>meetcode learner</strong>
<div>Practices 10 minutes daily.</div>
</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!