欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

css绑定弹窗

程序员文章站 2022-03-07 18:43:55
...

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>复选框</title>
<style>
input[type=”checkbox”]{
display: none;
}
input[type=”checkbox”]:checked ~ ul {
display: none;
}
</style>
</head>
<body>
<label for="menu">菜单</label>
<input type="checkbox" id="menu">
<ul>
<p>helolodldddf</p>
<p>helolodldddf</p>
<p>helolodldddf</p>
<p>helolodldddf</p>
<p>helolodldddf</p>
</ul>
</body>
</html>