Descendant Selector

Descendant Selector

Easy CSS CSS Foundations 23 views
Explanation Complexity

Problem Statement

In a nav, style only the links inside nav.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use a descendant selector like nav a.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use a descendant selector like nav a.

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 a { margin-right: 10px; color: #124; }
  </style>
</head>
<body>
  <nav>
    <a href='#'>Home</a>
    <a href='#'>Topics</a>
    <a href='#'>Login</a>
  </nav>
  <a href='#'>This link is outside nav</a>
</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 a { margin-right: 10px; color: #124; }
  </style>
</head>
<body>
  <nav>
    <a href='#'>Home</a>
    <a href='#'>Topics</a>
    <a href='#'>Login</a>
  </nav>
  <a href='#'>This link is outside nav</a>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.