I can't find a way to make my input field (a search box) and its relative icon (a magnifier lens) to float
to the right of the navbar in my website (while leaving my logo on the left of the nav). Any suggestion?
HTML:
<nav>
<div class="nav-container">
<div class="logo">
<a href="">
<h1>MyWebsiteName.com</h1>
</a>
</div>
<form action="javascript:redirect()" autocomplete="off">
<input type="search" name="search" id="search" class="form-control">
<ul class=mylist list-group" id="result"></ul> <!--this line is for JS-->
<button type="submit">
<svg width="50" height="50" viewBox="0 0 77 77" fill="none"
xmlns="http://www.w3.org/2000/svg">
</svg> </button>
</form>
</div>
</nav>
CSS:
.nav-container {
display: flex;
align-items: center;
padding: 16px 0;
position: relative;
}
.nav-container form {
display: flex;
align-items: center;
justify-content: center;
}
nav input {
font-size: 1.20em;
border: solid 2px #E5E5E5;
border-radius: 25px;
background: none;
color: #F4F4F4;
padding: 14px;
margin: 0 20px 0 0;
width: 260px;
}
form {
float: right;
}