2014-03-28 48 views
0

在我的网站上工作时,我添加了一些功能,如Snap.js(增加了一个侧面菜单,如Facebook一个)提供的功能。使用css3隐藏数据属性

使用响应式样式时出现问题。

我可以用以下值隐藏dragg选项:<data-snap-ignore="true">。但我不知道如何通过deskopt解决方案(以避免鼠标问题)将dispaly:none隐藏起来,并允许它在低分辨率(如平板电脑和手机)上运行。

有没有关于如何使用CSS3隐藏它的任何线索?

+0

你看着媒体查询? – Mohamad

+0

我正在使用媒体查询,但无法弄清楚如何只隐藏数据属性 –

回答

0

媒体查询的标准设备

/* Smartphones (portrait and landscape) ----------- */ 
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) { 
/* Styles */ 
} 

/* Smartphones (landscape) ----------- */ 
@media only screen 
and (min-width : 321px) { 
/* Styles */ 
} 

/* Smartphones (portrait) ----------- */ 
@media only screen 
and (max-width : 320px) { 
/* Styles */ 
} 

/* iPads (portrait and landscape) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) { 
/* Styles */ 
} 

/* iPads (landscape) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) { 
/* Styles */ 
} 

/* iPads (portrait) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) { 
/* Styles */ 
} 

/* Desktops and laptops ----------- */ 
@media only screen 
and (min-width : 1224px) { 
/* Styles */ 
} 

/* Large screens ----------- */ 
@media only screen 
and (min-width : 1824px) { 
/* Styles */ 
} 

/* iPhone 4 ----------- */ 
@media 
only screen and (-webkit-min-device-pixel-ratio : 1.5), 
only screen and (min-device-pixel-ratio : 1.5) { 
/* Styles */ 
}