Images as menu items
-
Dear @jw
this is not possible easily. You need to come up with a creative solution for this. CSS…
Best!Marius
-
Dear Marius,
I tried a bit of CSS butt have been struggling since I don't have too much knowledge in this field. From what I've gathered online, this could be the CSS to replace the Menu item:
text-indent: -100em; overflow: hidden; background: url(http://spandau20.com/wp-content/uploads/2020/05/mixtapes.png) no-repeat;
How can I address the menu item in my code? Using [data-id="161"] {...} was unsuccessful :(
spandau20.com is the website.
Cheers!
Julius -
Dear @jw
Can you post a link to your website?
We will then have a look and inspect that!
Many wishes!
Marius -
-
Dear @jw
play around with this:nav.primary li { display: inline-block; background: url(http://spandau20.com/wp-content/uploads/2020/05/mixtapes.png) no-repeat; background-size: contain; }
Best!
Marius -
Hey Marius,
this kind of worked. Now all of the menu points have the text overlaid. So now two questions arise:
-
How can I make the original text disappear?
-
How can I select only a single menu point? I tried with selecting via
[data-id="161"]{ ... }
and modifying yours to
nav.primary li menu-item-233 { display: inline-block; background: url(http://spandau20.com/wp-content/uploads/2020/05/mixtapes.png) no-repeat; background-size: contain; }
but that was not successful.
Best,
Julius -
-
Dear @jw
you cannot use data attributes to assign CSS.
I would recommend to have a look into some tutorials at Codeacademy https://www.codecademy.com/.
It is for free for the basics. The effect you are trying to achieve requires some knowledge and brainpower :-)
Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it