I'm having an issue where the search box expands in size when I apply display:flex
in my CSS. Can someone explain why this happens and offer a solution to return the search box to its normal height? Additionally, I would like the search bar and the search icon to remain together. Thank you for any assistance!
* {
font-family: "poppins";
margin: 0;
padding: 0;
text-decoration: none;
list-style: none;
box-sizing: border-box;
}
header {
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-between;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/style2.css" />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="caa8a5a5beb9beb8abbae7a3a9a5a4b98afbe4f2e4fa">[email protected]</a>/font/bootstrap-icons.css"
integrity="sha384-ejwKkLla8gPP8t2u0eQyL0Q/4ItcnyveF505U0NIobD/SMsNyXrLti6CWaD0L52l"
crossorigin="anonymous"
/>
<title>Document</title>
</head>
<body>
<header>
<a href="#">My Logo</a>
<ul class="navigation">
<a href="#"><li>Home</li></a>
<a href="#"><li>TV Shows</li></a>
<a href="#"><li>Movies</li></a>
<a href="#"><li>Latest</li></a>
<a href="#"><li>My List</li></a>
</ul>
<input type="text" placeholder="Search" />
<i class="bi bi-search"></i>
</header>
</body>
</html>