老师麻烦看一下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-compatible" content="IE=edge">
<title>bing搜索</title>
<style type="text/css">
body{
background:#333;
}
.bg-image{
background:url(image/river.jpg);
width:1286px;
height:768px;
margin:0 auto;
}
.search-box{
position:absolute;
left:370px;
top:200px;
}
.logo{
background:url(image/logo.png);
width:107px;
height:53px;
float:left;
margin:-7px 5px 0 0;
}
form{
float:left;
background:#fff;
padding:5px;
}
.input-search-text{
border:none;
outline:none;
width:350px;
height:30px;
float:left;
}
.input-search-button{
border:none;
outline:none;
background:url(image/search-button.png);
width:29px;
height:29px;
float:left;
}
.suggest{
/*position:absolute;
left:200px;
top:250px;*/
width:389px;
background:#fff;
border:1px solid #999;
}
.suggest ul{
list-style:none;
margin:0;
padding:0;
}
.suggest ul li{
padding:5px;
}
.suggest ul li:hover{
text-decoration:underline;
cursor:pointer;
background:#e5e5e5;
}
</style>
</head>
<body>
<div class="bg-image">
<div class="search-box">
<div class="logo"></div>
<form action="https://www.bing.com/search" method="get" id="search-form">
<input type="text" class="input-search-text" name="q" autocomplete="off" id="search-text"/>
<input type="submit" class="input-search-button" value=""/>
</form>
</div>
</div>
<div class="suggest" id="search-suggest" style="display:none;">
<ul class="suggest-list">
<li>提示搜索1</li>
<li>提示搜索2</li>
<li>提示搜索3</li>
</ul>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$('#search-text').bind('keyup',function(){
$('#search-suggest').show().css({
position:'absolute',
top:$('#search-form').offset().top+$('#search-text').height(),
left:$('#search-form').offset().left
});
})
</script>
</body>
</html>
这个是什么原因
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 467 份
- 解答问题 4826 个
本路径带你通过系统学习HTML5、JavaScript、jQuery的进阶知识,不仅如此,还会学习如何利用组件化的思想来开发网页,知识点+案例,使得所学可以更好的得到实践。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星