Overflow Hidden
CSS
Medium
3 views
Problem Description
Make an image inside a rounded card and hide overflow.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use overflow: hidden on the card.
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>
.card { width: 360px; border-radius: 14px; overflow: hidden; border: 1px solid #eee; }
.card img { display: block; width: 100%; height: 140px; object-fit: cover; }
.card .body { padding: 12px; }
</style>
</head>
<body>
<div class='card'>
<img src='banner.jpg' alt='meetcode banner'>
<div class='body'>
<strong>meetcode</strong>
<p>Rounded image crop.</p>
</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!