Replace menu item with icon (Prestashop theme)

…衆ロ難τιáo~ 提交于 2019-12-11 15:05:55

问题


I'd like to ask you about the way to replace the text with icon (home icon as the first menu child).

My css is similar to this one: http://livedemo00.template-help.com/prestashop_53577/

I've added this code at the end of the global.css:

.sf-menu li:first-child a:before{
  content: "\f015";
  font-family: "FontAwesome";
  display: inline-block;
  font-size: 33px;
  line-height: 70px;
  color: black;
}

.sf-menu li ul li a:before{
  content:none!important;
}

which gives:

What's the best way to hide the text "Clothing"?


回答1:


You just need to add

text-indent: -9999em

to .sf-menu li:first-child, to indent the text out of view a and then

text-indent: 0

to .sf-menu li:first-child a:before, to reset the property for the pseudo selector



来源:https://stackoverflow.com/questions/31263267/replace-menu-item-with-icon-prestashop-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!