Files
ClassContent/历届学生/吴欣阳/项目开发/上课项目/百度搜索条2.html
2024-09-27 02:06:13 +08:00

106 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>百度搜索条方法2 定位实现</title>
<style>
body,
ul,
li,
p,
h1,
h2,
h3,
h4,
h5,
input,
h6 {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
input {
border: none;
outline: none;
}
a {
text-decoration: none;
}
.search {
width: 654px;
height: 44px;
margin: 50px auto;
}
.search .left {
width: 546px;
height: 44px;
float: left;
position: relative;
}
.left input {
width: 100%;
height: 100%;
border: 2px solid #c4c7ce;
box-sizing: border-box;
border-radius: 10px 0 0 10px;
border-right: none;
padding-left: 15px;
font-size: 16px;
}
.left input:focus {
border: 2px solid #4e6ef2;
box-sizing: border-box;
}
.left .img {
width: 24px;
height: 20px;
background: url("https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/searchbox/nicon-10750f3f7d.png");
position: absolute;
right: 22px;
top: 50%;
margin-top: -10px;
background-position: 0px -51px;
}
.left .img:hover {
background-position: 0px -75px;
}
.submit {
width: 108px;
height: 100%;
background: #4e6ef2;
color: #fff;
float: left;
border-radius: 0 10px 10px 0;
font-size: 17px;
}
</style>
</head>
<body>
<div class="search">
<div class="left">
<input type="text" class="keyword">
<div class="img"></div>
</div>
<input type="button" class="submit" value="百度一下">
</div>
</body>
</html>