Center Nav Links
CSS
Easy
2 views
Problem Description
Center nav links horizontally using flex.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use justify-content: center on nav.
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>
nav { display: flex; justify-content: center; gap: 14px; padding: 12px; border: 1px solid #eee; border-radius: 14px; }
a { text-decoration: none; color: #124; }
</style>
</head>
<body>
<nav>
<a href='#'>Home</a>
<a href='#'>Topics</a>
<a href='#'>Practice</a>
</nav>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!