Center Item in Grid
CSS
Easy
2 views
Problem Description
Center a single card using place-items: center.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use a grid container and place-items: center.
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>
body { margin: 0; }
.stage { min-height: 100vh; display: grid; place-items: center; }
.card { border: 1px solid #eee; border-radius: 14px; padding: 18px; width: 320px; }
</style>
</head>
<body>
<div class='stage'>
<div class='card'>Centered meetcode card</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!