Hello i was trying to create a navbar and a red box below it. But red box came in the navbar .
I used css and html only . I have also provided the before and after of the outcomes

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet" type="text/css" />
<title></title>
</head>
<body>
<div >
<img src="background.png" >
<nav>
<ul >
<li><a href='#' >Search</a></li>
<li><a href='#' >Browse</a></li>
<li><a href='#' >Tags</a></li>
<li><a href='#' >Filter</a></li>
<li><a href='#' >Dev</a></li>
</ul>
</nav>
<div ><a href="#" class='sign'>Sign In</a</div>
</div>
<div >abcd</div>
</body>
</html>
CodePudding user response:
Add the closing bracket of the anchor element
<div ><a href="#" class='sign'>Sign In</a></div>
