Grid Item Self Align
CSS
Medium
3 views
Problem Description
Align one grid item to the end using justify-self and align-self.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use justify-self and align-self on a single item.
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>
.grid { display: grid; grid-template-columns: 1fr 1fr; height: 220px; gap: 12px; border: 1px dashed #bbb; padding: 12px; }
.item { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
.end { justify-self: end; align-self: end; }
</style>
</head>
<body>
<div class='grid'>
<div class='item'>Normal</div>
<div class='item end'>meetcode end</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!