【发布时间】:2012-03-28 23:04:29
【问题描述】:
我想知道是否可以在特定视口的媒体查询中简单地隐藏“管道”(例如:|)字符?
我想知道,因为我有一个将它们用作分隔符的菜单,但在移动视口上的渲染效果很差,如果我能以某种方式隐藏它们,LOVE 也会如此。
我想我可能必须在移动视口中使用一些 jQuery 和我定义的 CSS?
有什么建议吗?
上午 10:38 更新: 感谢大家的精彩回复;我已经尝试建议将类添加到 span 标签,现在我的管道没有显示交叉,下面是我拥有的 footer.php 中的标记以及媒体 Q 中的相应隐藏。
<li class="f"><a href="#" class="scrolltime">EXPLORE</a> <span class="pipe"> | </span></li>
<li class="f"><a href="#" class="scrolltime"> FOR</a><span class="pipe"> | </span></li>
<li class="f"><a href="#" class="scrolltime">ENHANCED</a><span class="pipe"> | </span> </li>
<li class="f"><a href="/iframe/buybutton.html" class="fancybox-iframe" style="color:#C6C699;">Iframe</a></li>
</ul>
CSS3:
/* Smartphones (Landscape) ----------- */
@media only screen and (min-width: 320px) and (max-width: 480px) {
#topvidarea {
margin-left: 24%;
margin-right: 20%;
margin-top: -265px;
max-width: 400px;
}
#topbgimg { display: none; }
#topbtn, #topbtn2, #topbtn3 {
border: 0 solid #C6C699;
display: inline;
float: left;
font-family: Georgia;
margin-right: 5px;
text-align: center;
width: 122px;
}
#topvidarea {
margin-left: 24%;
margin-right: 20%;
margin-top: 15px;
max-width: 400px;
}
#footer a {
font-size: 8px;
margin: 0;
padding: 12px;
text-indent: 1px;
}
.f {
float: none;
margin-top: -2px;
padding-left: 0;
}
.pipe { display: none; }
}
【问题讨论】:
-
你能分享相关代码,或者更好的是,为它制作一个fiddle吗?
标签: jquery css media-queries responsive-design