Search This Blog

Sunday, May 16, 2021

How to Redirect a Search Form to a Site-Scoped Google Search


How to Redirect a Search Form to a Site-Scoped Google Search

<!DOCTYPE html>



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

<link rel="stylesheet" href="">


body {

  font-family: Arial;


* {

  box-sizing: border-box;


form.example input[type=search] {

  padding: 10px;

  font-size: 17px;

  border: 1px solid grey;

  float: left;

  width: 80%;

  background: #f1f1f1;


form.example button {

  float: left;

  width: 20%;

  padding: 10px;

  background: #2196F3;

  color: white;

  font-size: 17px;

  border: 1px solid grey;

  border-left: none;

  cursor: pointer;


form.example button:hover {

  background: #0b7dda;


form.example::after {

  content: "";

  clear: both;

  display: table;





<form class="example" action="" target="_blank" type="GET">

  <input type="search" placeholder="Search.." name="q">

  <button type="submit"><i class="fa fa-search"></i></button>




No comments: