JavaScript实例之实现选项卡
源码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
ul,li{
margin:0;
padding:0;
list-style: none;
}
ul{
overflow: hidden;
}
li{
width: 100px;
height: 40px;
background-color: #eee;
border: 1px solid #ccc;
float: left;
line-height: 40px;
text-align: center;
}
div{
width: 406px;
height: 406px;
border: 1px solid #ccc;
}
img{
width: 406px;
height: 406px;
display: none;
}
</style>
</head>
<body>
<ul>
<li>花1</li>
<li>花2</li>