Nav Wrap on Small Screen
CSS
Easy
2 views
Problem Description
Make nav links wrap to next line on small screens.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use flex-wrap and gap.
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; flex-wrap: wrap; gap: 10px; padding: 12px; border: 1px solid #eee; border-radius: 14px; }
a { padding: 8px 10px; border-radius: 12px; border: 1px solid #eee; text-decoration: none; color: #124; }
</style>
</head>
<body>
<nav>
<a href='#'>Home</a>
<a href='#'>Topics</a>
<a href='#'>Practice</a>
<a href='#'>Notes</a>
<a href='#'>Profile</a>
</nav>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!