Search Button
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<h2>Search Button</h2>
<p>Full width</p>
<form>
<input type="text"placeholder="Search"name="Search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
<p>Centered inside a form with max-width:
</p>
<form style="margin:auto; max-width: 300px;">
<input type="text"placeholder="Search"name="Search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</body>
</html>
CSS Search Button Style
*{
box-sizing: border-box;
}
body{
font-family: Arial, Helvetica, sans-serif;
}
input[type=text]{
padding:10px;
font-size:17px;
border:1px solid grey;
float: left;
width:80%;
background-color: #f2f2f2;
}
button{
float: left;
width:20% ;
padding:10px ;
font-size:17px ;
background-color: #2196f3;
color: #fff;
border:1px solid grey ;
border-left: none;
cursor: pointer;
}
button:hover{
background-color:#0b7dda ;
}
form::after{
content: "";
display: table;
clear: both;
}
No comments:
Post a Comment