我有一个模式按钮,先将其隐藏然后再显示。该按钮不出现。怎么显示?
button {
display: none;
}
@media screen and (max-width: 599px) {
display: block;
}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter"> Modal
</button>
答案 0 :(得分:1)
检查您的媒体查询代码 注意:-您的按钮将按照您的代码显示在559px的视口上
button{display:none;}
@media screen and (max-width:599px){
button{display:block;} /*issue exits here*/
}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
Modal
</button>