d1ck3n
Goto Top

Mit eigener Suchleiste über Google suchen

Hallo zusammen,

das ist vielleicht eine sehr simple Frage und ich habe bestimmt nur was übersehen, aber ich bekomme es einfach nicht hin, mit folgender Suchleiste über Google zu suchen:

 
<!doctype html>
<html>
<head>
<title>searchbar</title>
<meta charset="UTF-8">  
<link rel="stylesheet" href="search.css">  
</head>
<body>
<form class="search" role="form" method="get" action="https://www.google.com/search"><input class="searchTerm" placeholder="Enter your search term ..."  /><input class="searchButton" type="submit" /></form>  
</body>
</html>

Hier die CSS:
 
@import url(http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
.search {
  width: 100%;
  position: relative;
}
.search:before {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-family: 'FontAwesome';  
  content: '\f002';  
  background: #8FC357;
  text-align: center;
  color: #fff;
  border-radius: 5px;
  -webkit-font-smoothing: subpixel-antialiased;
  font-smooth: always;
}

.searchTerm {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 100%;
  border: 5px solid #8FC357;
  padding: 5px;
  height: 40px;
  border-radius: 5px;
  outline: none;
}

.searchButton {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  opacity: 0;
  cursor: pointer;
}

Wenn ich was eingebe und es bestätige, öffnet sich zwar Google, aber mein Begriff wird dort nicht gesucht face-sad

Ich hoffe, mir kann jemand helfen.

Gruß
D1Ck3n

Content-Key: 277950

Url: https://administrator.de/contentid/277950

Printed on: April 19, 2024 at 14:04 o'clock

Member: nextized
Solution nextized Sep 02, 2015, updated at Sep 03, 2015 at 08:33:14 (UTC)
Goto Top
Hallo D1Ck3n

Der Input Tag muss noch etwas angepasst werden:

<form class="search" role="form" method="get" action="https://www.google.com"><input name="#q" class="searchTerm" placeholder="Enter your search term ..."  /><input class="searchButton" type="submit" /></form>  

Gruss

nextized
Member: colinardo
Solution colinardo Sep 02, 2015, updated at Sep 03, 2015 at 08:33:11 (UTC)
Goto Top
Für die Suche über Site /search/ must du den Namen des Textfeldes noch mit q benennen.
<!doctype html>
<html>
<head>
<title>searchbar</title>
<meta charset="UTF-8">  
<link rel="stylesheet" href="search.css">  
</head>
<body>
<form class="search" role="form" method="get" action="https://www.google.com/search">  
	<input type="text" name="q" placeholder="Enter your search term ..."  />  
	<input class="searchButton" type="submit" />  
</form>
</body>
</html>
Grüße Uwe
Member: D1Ck3n
D1Ck3n Sep 03, 2015 at 08:34:27 (UTC)
Goto Top
Hallo Uwe und nextized,

mit name="q" hat es geklappt!

Vielen Dank euch beiden!

Gruß
D1Ck3n