请问这个效果用HTML+CSS应该如何实现?

2024-12-20 22:52:20
推荐回答(1个)
回答1:

html:


css:

div{
display: none;
}
ul,li{
list-style:none;
padding:0;
}
li{
width:100px;
border-top:1px solid #ddd;
text-align:center;
padding:5px;
}
button{
background:dodgerblue;
border:0;
color:#fff;
padding:5px 20px;
}
js:
var isClick=true;
$("#btn").click(function(){
if(isClick){
$("div").css("display","block");
isClick = false;
}else{
$("div").css("display","none");
isClick = true;
}
})