发布网友 发布时间:2022-04-26 19:01
共3个回答
热心网友 时间:2022-04-21 02:31
如果你只是想模仿一下,试试我这个代码。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>输入提示</title>
<script>
</script>
<style>
body {
font-family: "微软雅黑";
}
#search_box {
position: relative;
}
#search_box input {
font-family: "微软雅黑";
width: 160px;
outline: none;
padding: 5px;
border: 1px solid darkgray;
}
#search_box input:focus{
box-shadow: 1px 2px 7px rgba(10,10,10,0.2);
}
#search_box ul {
display: block;
padding: 0px;
margin: 0px;
width: 170px;
border: 1px solid darkgray;
border-top: none;
font-size: 13px;
list-style: none;
display: none;
}
#search_box li {
padding: 5px;
}
#search_box li:hover {
background: rgb(240, 240, 240);
}
</style>
</head>
<body>
<div id="search_box">
<input type="text" onfocus="document.getElementById('search_advice').style.display='block'" onblur="document.getElementById('search_advice').style.display='none'" placeholder="请输入" />
<ul id="search_advice">
<li>提示1</li>
<li>提示2</li>
<li>提示3</li>
<li>提示4</li>
<li>提示5</li>
</ul>
</div>
</body>
</html>
热心网友 时间:2022-04-21 03:49
<!DOCTYPE html>追问你好!虽然这段代码在W3School测试可以用,但是还是用到了jquery,导致在现场环境中用不了!
追答你从哪里看到了jQuery,不要看到个$就是jQuery
热心网友 时间:2022-04-21 05:23
<!doctype html>