天猫搜索框html代码
时间: 2023-08-12 18:09:06 浏览: 129
天猫搜索框的HTML代码如下:
```
<form action="//list.tmall.com/search_product.htm" target="_top" method="get">
<div class="s-combobox">
<input type="text" name="q" value="" autocomplete="off" placeholder="搜索 天猫 商品/品牌/店铺" class="s-combobox-input">
<button type="submit" class="s-combobox-btn">
<span class="s-icon"></span>
</button>
</div>
</form>
```
其中,`name="q"` 的 input 标签是用来输入搜索关键字的,`action="//list.tmall.com/search_product.htm"` 指定了搜索提交的地址,`placeholder="搜索 天猫 商品/品牌/店铺"` 则是搜索框的提示文字。
相关问题
天猫搜索栏代码
以下是天猫搜索栏的示例代码(HTML + CSS):
```html
<div class="search-bar">
<form>
<input type="text" placeholder="搜索 商品/品牌/店铺" />
<button type="submit">搜索</button>
</form>
</div>
```
```css
.search-bar {
display: flex;
align-items: center;
justify-content: center;
height: 50px;
background-color: #f5f5f5;
}
.search-bar input[type="text"] {
width: 400px;
height: 30px;
padding: 5px 10px;
border: none;
border-radius: 15px;
font-size: 14px;
}
.search-bar button[type="submit"] {
width: 80px;
height: 30px;
margin-left: 10px;
border: none;
border-radius: 15px;
background-color: #ff6700;
color: #fff;
font-size: 14px;
cursor: pointer;
}
```
你可以根据需要进行修改和优化。
天猫html+css代码
以下是一个简单的天猫静态页面的HTML和CSS示例,包括一个基本的登录表单和一些样式:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>天猫登录页面</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="container">
<h1>欢迎来到天猫!</h1>
<form action="login.php" method="POST">
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br><br>
<input type="submit" value="登录">
</form>
</div>
</body>
</html>
```
CSS代码:
```css
#container {
margin: 0 auto;
width: 400px;
padding: 20px;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 5px;
}
h1 {
text-align: center;
font-size: 32px;
margin-bottom: 30px;
}
form {
text-align: center;
}
label {
display: block;
font-size: 18px;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
padding: 10px;
font-size: 18px;
border-radius: 5px;
border: 1px solid #ccc;
margin-bottom: 20px;
width: 100%;
box-sizing: border-box;
}
input[type="submit"] {
padding: 10px 20px;
font-size: 18px;
background-color: #f90;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
```
需要注意的是,这只是一个简单的示例,实际的天猫页面可能会更加复杂。