上效果图:
挺有意思的,无聊得时候自己玩一下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
list-style: none
}
.box {
margin: 50px auto;
width: 600px;
position: relative;
}
ul {
width: 100%;
/* margin: 5px; */
padding: 2px;
min-height: 200px;
max-height: 400px;
overflow-y: auto;
border: 2px solid #666;
border-radius: 10px;
}
li {
padding: 0 8px;
margin: 2px;
background: #ccc;
float: left;