Unfortunately it looks like you can't hide link text with CSS. On my WordPress site, at 375 px and below, the titles of the links in the secondary-navbar
start to overlap.
不幸的是,看起来你无法用CSS隐藏链接文本。在我的WordPress站点上,在375像素和下面,二级导航条上的链接标题开始重叠。
请为你自己
What I'm trying to do is to say "as soon as the titles start to overlap (at 375px and below), make the titles disappear." I'd also like to make the glyphicons larger and centered.
我想做的是说:“一旦标题开始重叠(在375px和以下),标题就会消失。”我还想让符号更大,更集中。
Here's a link to my header.php file. I didn't write the code for this site and am not very familiar with the wp_nav_menu
function, but I would guess that it's probably line 62 that's causing the menu titles to appear in the div with the nav navbar-nav secondary-links
class.
这是链接到我的标题。php文件。我没有为这个站点编写代码,也不太熟悉wp_nav_menu函数,但是我猜可能是第62行,这导致了菜单标题出现在div中,与nav navbar-nav二级链接。
So then, if that is the problem, how do we get that specific part of the function to disappear at 375px and below?
那么,如果这就是问题所在,我们如何让这个函数的特定部分消失在375px下面呢?
I tried commenting out line 62 and got a pretty bad result:
我试着注释掉第62行,结果很糟糕:
Please point me in the right direction if you have any suggestions / ideas. Maybe there's a way to disable the titles with JQuery? Thank you.
如果你有什么建议/想法,请告诉我正确的方向。也许有一种方法可以用JQuery禁用标题?谢谢你!
1 个解决方案
#1
3
Here is the solution put it in the end of the stylesheet file.
这里是将它放在样式表文件末尾的解决方案。
@media only screen and (max-width:480px) {
.secondary-navbar .navbar-nav > li > a{font-size:0px;}
.secondary-navbar .navbar-nav > li > a:hover{font-size:0px;}
.secondary-navbar .navbar-nav > li > a span{font-size:20px!important;}
}
#1
3
Here is the solution put it in the end of the stylesheet file.
这里是将它放在样式表文件末尾的解决方案。
@media only screen and (max-width:480px) {
.secondary-navbar .navbar-nav > li > a{font-size:0px;}
.secondary-navbar .navbar-nav > li > a:hover{font-size:0px;}
.secondary-navbar .navbar-nav > li > a span{font-size:20px!important;}
}