Google Search Engine Website Source Code



HTML

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Google (AR Computer Tech)</title>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>


<section>

<div class="main">

<img src="google.png">


              <div class="searchbox">

              <input type="text" name="" class="query" value="">


              <div class="icons">


              <div><img src="search.png"></div>

              <div><img src="mic.png"></div>

              </div>

              </div>


              <div class="button">

              <button class="searchbutton">Google Search</button>

              </div>


</div>


</section>

</body>

</html>


CSS

*{

margin:0;

padding: 0;

box-sizing: border-box;

font: sans-serif;

}

section{

position: relative;

width: 100%;

height: 100vh;

display: flex;

justify-content: center;

}

section .main{

width: 280px;

margin: 0 20px;

display: flex;

justify-content: center;

align-items: center;

flex-direction: column;

}

section .main .searchbox{

position: relative;

width: 100%;

margin-top: 10px 20px;

}

section .main .searchbox .query{

width: 100%;

padding: 13px;

border: 1ps solid #ccc;

outline: none;

font: 16px;

border-radius: 30px;

padding-left: 45px;

padding-right: 60px;

}

section .main .searchbox .icons{

position: absolute;

top: 0;

width: 100%;

display: flex;

justify-content: space-between;

padding: 10px 20px;

align-items: center;

pointer-events: none;

}

section .main .searchbox .icons .img{

max-width: 100%;

}

.searchbutton{

margin: 0 5px;

margin-top: 20px;

padding: 12px 20px;

color: #555;

font-size: 15px;

cursor: pointer;

border-left-color: #ff7;

border-right-color: #ff7;

}

.searchbutton:hover{

background: #000;

color: #fff;

border-right-color: #ff7200;

border-left-color: #FF00FF00;

border-radius: 30px;

transition: 0.9s ease;

}

JavaScript

<script type="text/javascript">

let query = document.querySelector ('.query');

let searchbutton = document.querySelector('.searchbutton');

searchbutton.onclick = function(){

let url = 'https://www.google.com/search?q='+query.value;

window.open (url,'_self' );

}

</script>

To Top