删除某些屏幕尺寸的元素 [英] Remove element for certain screen sizes
本文介绍了删除某些屏幕尺寸的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在使用媒体查询创建响应式网页设计。对于移动设备,我想删除我的JS滑块并将其替换为其他内容。我已经看过JQuery库中的 .remove()
和其他一些东西,但是这些都必须在HTML中实现,我无法想到从css angle。
解决方案
你需要删除它们,还是只隐藏它们?如果只是隐藏,那么你可以将媒体查询与 display:none
结合:
display:block;
}
@media(max-width:640px)
{
#mySlider
{
display:none;
}
}
I am currently creating a responsive web design using media queries. For mobile devices I want to remove my JS slider and replace it with something else. I have looked at .remove()
and a few other things from the JQuery library, however these have to be implemented into the HTML and I cannot think of a work around from the css angle.
解决方案
Do you need to remove them, or just hide them? If just hiding is okay, then you can combine media queries with display:none
:
#mySlider{
display: block;
}
@media (max-width: 640px)
{
#mySlider
{
display: none;
}
}
这篇关于删除某些屏幕尺寸的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文