HTML练习--制作畅销书排行页面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.a {
	width:300px;
	background-color: #3C3;
	background-repeat: no-repeat;
	background-position: 95px; center;
	background-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/bang.gif);
	padding:10px;
}
.e {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no03.gif);
	list-style-type: none;
}
.m {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no10.gif);
	list-style-type: none;
}
.k {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no08.gif);
	list-style-type: none;
}
.g {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no05.gif);
	list-style-type: none;
}
.f {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no04.gif);
	list-style-type: none;
}
.j {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no07.gif);
	list-style-type: none;
}
.b {
	width:320px;
	height:500px;
	background-color: #CC3;
}
.c {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no01.gif);
	list-style-type: none;
}
.d {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no02.gif);
	list-style-type: none;
}
.d {
}
.d {
}
.tet {
	font-family: "Comic Sans MS", cursive;
	font-size: 12px;
	font-style: normal;
	line-height: 28px;
	font-weight: normal;
	font-variant: normal;
	color: #00F;
}
.h {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no06.gif);
	list-style-type: none;
}
.l {
	list-style-position: outside;
	list-style-image: url(../%E7%BB%83%E4%B9%A05%EF%BC%9A%E5%88%B6%E4%BD%9C%E7%95%85%E9%94%80%E4%B9%A6%E6%8E%92%E8%A1%8C%E6%A6%9C/%E5%9B%BE%E7%89%87%E7%B4%A0%E6%9D%90/book_no09.gif);
	list-style-type: none;
}
</style>
</head>
<body>
<div class="a">畅销书排行</div>
<div class="b">
<ul class="tet">
<li class="c"><a href="#"/>不抱怨的世界(畅...</a></li>
<li class="d"><a href="#"/>遇见未知的自己...</a></li>
<li class="e"><a href="#"/>活法(季羡林、...</a></li>
<li class="f"><a href="#"/>高效能人士的七个习惯</a></li>
<li class="g"><a href="#"/>被迫强大(北外女生香奈儿...</a></li>
<li class="h"><a href="#"/>遇见心想事成的自己(《遇...</a></li>
<li class="j"><a href="#"/>我的成功可以复制(唐骏亲...</a></li>
<li class="k"><a href="#"/>被迫强大(北外女生香奈儿...</a></li>
<li class="l"><a href="#"/>少有人走的路:心智成熟的...</a></li>
<li class="m"><a href="#"/>活出全新的自己——唤醒...</a></li>

</ul>


</div>
</body>
</html>

  • 6
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!感谢您的提问。下面是一个简单的 HTML 列表搜索的前端实例练习: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>可搜索列表</title> <style> /* 样式可以根据自己的喜好进行调整 */ ul { list-style-type: none; padding: 0; margin: 0; } li { padding: 10px; border-bottom: 1px solid #ccc; } input { padding: 10px; width: 100%; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; margin-bottom: 10px; } </style> </head> <body> <input type="text" id="myInput" onkeyup="myFunction()" placeholder="搜索..."> <ul id="myUL"> <li>苹果</li> <li>香蕉</li> <li>橙子</li> <li>梨子</li> <li>西瓜</li> </ul> <script> function myFunction() { // 获取输入框的值 var input, filter, ul, li, a, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); ul = document.getElementById("myUL"); li = ul.getElementsByTagName("li"); // 遍历所有列表项,如果文本中包含输入框的值,则显示,否则隐藏 for (i = 0; i < li.length; i++) { a = li[i]; txtValue = a.textContent || a.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ""; } else { li[i].style.display = "none"; } } } </script> </body> </html> ``` 这个例子中,我们创建了一个 `<ul>` 列表,包含了一些水果名称。同时,我们创建了一个文本输入框,用于搜索列表中的内容。当用户输入文本时,我们使用 JavaScript 的 `myFunction()` 函数来检查输入框的值是否在列表项中出现过。如果出现过,我们将其显示出来,否则隐藏。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值