How can i make a search bar with a button on the right and an input field that goes to the start of that button?
This is what i get
I want to get rid of the line break somehow.
I tried using calc(), setting width to 100%, neither of those worked.
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
background: rgb(237,237,237);
background: linear-gradient(0deg, rgba(237,237,237,1) 0%, rgba(255,255,255,1) 100%);
min-height: 100vh;
}
body {
min-height: 100vh;
position: relative;
display: flex;
flex-direction: column;
}
.searchBtn {
float: right;
height: 50px;
width: 50px;
}
#searchBox{
height: 50px;
width: 100%;
}
#navbar {
background-color: turquoise;
min-height: 50px;
top: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="css2.css" rel="stylesheet">
</head>
<body>
<div id="navbar">
<input type="text" placeholder="Search..." id="searchBox">
<button type="submit" class="searchBtn">Src</button>
</div>
</body>
</html>
@amarinediary i needed the asnwer asap so i didnt have time to do the research, tnx