In: Computer Science
For h1 headings that are direct children of the nav element:
Please upvote if you are able to understand this and if there is any query do mention it in the comment section.
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
nav h1 {/* styling the h1(s) of nav */
font-size: 1.2em;
color: white;
background-color: black;
text-align: center;
}
</style>
</head>
<body>
<!-- creating the nav element -->
<nav>
<!-- creating the h1 which are direct children of nav -->
<h1>First heading</h1>
<h1>Second heading</h1>
<h1>Third heading</h1>
<h1>Fourth heading</h1>
</nav>
</body>
</html>
OUTPUT:
If this was supposed to be done in any other way then please mention it in the comment section otherwise please upvote.