Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Images as menu items

Images as menu items

Scheduled Pinned Locked Moved General Discussion
8 Posts 2 Posters 356 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jw
    wrote on last edited by
    #1

    Hello,

    I would like to replace my menu items with custom images. Is this possible? I feel like I saw the feature somewhere some time...

    Best
    Julius

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @jw
      this is not possible easily. You need to come up with a creative solution for this. CSS…
      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jw
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @jw
          Can you post a link to your website?
          We will then have a look and inspect that!
          Many wishes!
          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jw
            wrote on last edited by
            #5

            Hi Marius,

            it is spandau20.com

            Thank you!

            1 Reply Last reply
            0
            • mariusjopenM Offline
              mariusjopenM Offline
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              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

              www.mariusjopen.world

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jw
                wrote on last edited by
                #7

                Hey Marius,

                this kind of worked. Now all of the menu points have the text overlaid. So now two questions arise:

                1. How can I make the original text disappear?

                2. 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

                1 Reply Last reply
                0
                • mariusjopenM Offline
                  mariusjopenM Offline
                  mariusjopen
                  Global Moderator
                  wrote on last edited by
                  #8

                  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

                  www.mariusjopen.world

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  I also code custom websites or custom Lay features.
                  💿 Email me here: 💿
                  info@laytheme.com

                  Before you post:
                  1. When using a WordPress Cache plugin, disable it or clear your cache.
                  2. Update Lay Theme and all Lay Theme Addons
                  3. Disable all Plugins
                  4. 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:
                  1. Post a link to where the problem is
                  2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                  3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                  Online Users
                  R
                  rospax
                  Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                  laytheme.com
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Search