简体   繁体   English

使用精灵时在Joomla中隐藏菜单项

[英]Hiding menu item in Joomla when using sprite

I want to create a menu item in Joomla 3 however use a sprite image instead of the link name. 我想在Joomla 3中创建一个菜单项,但是使用Sprite图像代替链接名称。 To do so I use the following html code and CSS to add a background image. 为此,我使用以下html代码和CSS添加背景图片。

<a class="mobile-icon-cart sprite" href="/index.php/cart" style="width: 40px; height: 40px; display: block;">Cart</a>

How can I hide the text "Cart" in a nice way. 如何以一种很好的方式隐藏文本“购物车”。 Hiding the text from Joomla backend only works when uploading a picture but then I can't use the sprite image. 从Joomla后端隐藏文本仅在上传图片时有效,但是我不能使用Sprite图片。 Also I would not like to use color:#fff; 我也不想使用color:#fff; for text. 用于文本。

Can't you use display:none ? 您不能使用display:none吗?
If you can't use display:none , you can try with removeChild() http://www.w3schools.com/jsref/met_node_removechild.asp or removeAttribute() http://www.w3schools.com/jsref/met_element_removeattribute.asp 如果您不能使用display:none ,则可以尝试使用removeChild() http://www.w3schools.com/jsref/met_node_removechild.asp或removeAttribute() http://www.w3schools.com/jsref/met_element_removeattribute。天冬氨酸

Use 采用

width:0;
height :0; 
padding :40px 40px 0 0; 
overflow: hidden ; 
display: block;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM