Center Nav Links

Center Nav Links

Easy CSS Flexbox Layout 22 views
Explanation Complexity

Problem Statement

Center nav links horizontally using flex.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use justify-content: center on nav.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use justify-content: center on nav.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!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>

Official Solution Code

<!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>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.