Flex Card Footer Push
CSS
Hard
4 views
Problem Description
Inside a card, push the button to bottom using flex column and margin-top auto.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use display flex on card and margin-top: auto on button row.
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: 320px; border: 1px solid #eee; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; min-height: 180px; }
.actions { margin-top: auto; }
button { padding: 10px 12px; border-radius: 12px; border: 0; background: #0b5; color: #fff; }
</style>
</head>
<body>
<div class='card'>
<h2>meetcode</h2>
<p>Short card content.</p>
<div class='actions'>
<button type='button'>Start</button>
</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!