The search bar unites people with websites, mobile apps, and the world. It’s a communication window within the user and the app or website. In the face of complex web content, users express their needs by searching keywords, expecting to obtain accurate information and quick and smooth user experience.
A well-designed search bar can improve conversion charges and enhance user knowledge. Despite its rank, the search bar is a simple part of a website or app and can very quickly get overlooked.
Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.
After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.
<!DOCTYPE html>
<html>
<head>
<title>Search Box</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="main">
<input type="text" name="box" placeholder="Search Anything You......">
<a href="#"><i class="fa fa-search"></i></a>
</div>
</body>
</html>
Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.
*{
margin: 0;
padding: 0;
font-family: sans-serif;
}
body{
background:#183969;
}
.main{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
input{
border:3px solid #32e17c;
height: 32px;
width: 300px;
border-radius: 50px;
padding: 0px 10px;
}
a{
font-size:30px;
}
No comments: