<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.kuang{padding-left: 10px; padding-right: 10px; border: 1px solid #FF0000; border-radius: 3px; display: inline-block; height: 20px; line-height:20px ;}
ul{ padding: 0; margin: 0;}
.list{height: 25px; line-height: 25px; border-bottom: 1px solid #ececec; list-style: none; width: 300px;}
</style>
</head>
<body>
<div class="top">
<!--<div class='kuang'></div>-->
</div>
<ul class="bottom">
<li class="list" disabled="disabled">计算机软件</li>
<li class="list">计算机硬件</li>
<li class="list">计算机服务</li>
<li class="list">通讯</li>
<li class="list">互联网</li>
</ul>
<script src="jquery-1.11.0.js"></script>
<script>
var index;
$(".list").click(function(index){
var aa = $(this).text();
index = $(this).index();
$(".top").append("<div class='kuang' id='"+index+"'>"+aa+"</div>");
});
</script>
</body>
</html>
方案1:
方案2:
方案3: