在 HTML 和 CSS 中像谷歌一样的搜索栏

新手上路,请多包涵

我正在学习 HTML , CSS 我在制作像谷歌这样的搜索栏时遇到了问题。你能给我任何建议吗,我做错了什么,尤其是尺寸方面的问题?谢谢 :)

 <!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns:th="http://www.thymeleaf.org">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</link>
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
</link>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="shortcut icon" type="image/x-icon" href="https://image.freepik.com/photos-libre/courbe-de-vapeur-de-la-fumee-d&-39;onde_19-123974.jpg" />
<style>
  .container {
    width: 1000px;
    margin-top: 100px;
    text-align: center;
  }
  h2 {
    font-family: "Trebuchet MS", Helvetica, sans-serif;
    size: 150px;
    fill: #294F6D;
  }
  div {
    width: 500px;
    height: 50px;
  }
  h1 {
    text-align: center;
    fill: 02111 D;
  }
  .search input[type="search"] {
    width: 400px;
    height: 50px;
  }
</style>
<body>
  <div class="container"
    <form action="/worldoffragrance">
      <input name="search" />
      <input type="submit" value="GO" />
    </form>
  </div>
</body>
</html>

感谢您的任何建议 :)

原文由 kajasha 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 271
1 个回答

试试这个,这可能会以某种方式帮助你。

更新

 input{
    border: none;
    padding: 10px;
    margin: 10px;
    height: 20px;
    width: 500px;
    border:1px solid #eaeaea;
    outline:none;
}
input:hover{
    border-color: #a0a0a0 #b9b9b9 #b9b9b9 #b9b9b9;
}
input:focus{
    border-color:#4d90fe;
}

input[type="submit"] {
    border-radius: 2px;
    background: #f2f2f2;
    border: 1px solid #f2f2f2;
    color: #757575;
    cursor: default;
    font-size: 14px;
    font-weight: bold;
    width: 100px;
    padding: 0 16px;
    height:36px;
}
input[type="submit"]:hover {
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    background: #f8f8f8;
    border: 1px solid #c6c6c6;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    color: #222;
}
 <div class="main">
<input type="text" />
<input type="submit" value="Go">
</div>

原文由 Hitesh Misro 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏