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. use different fonts in one menu item ?

use different fonts in one menu item ?

Scheduled Pinned Locked Moved General Discussion
9 Posts 3 Posters 125 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.
  • D Offline
    D Offline
    danny
    wrote on Jul 26, 2024, 1:50 PM last edited by
    #1

    Dear @arminunruh,

    is it possible to use different fonts in one menu item? I would like to use three different fonts for menu-item-92 (tiran willemse in the left lower corner). Meaning the T would be another font the I, then R and so on. So it would look like this (see image). Note: these are not different cuts, but different fonts.

    I would like to do the same for menu-item 97 (contact @).

    Bildschirmfoto 2024-07-25 um 14.16.24.png

    https://tiranwillemse.com/fullscreen2/

    Thanks a lot. best wishes
    Daniel

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arminunruh
      Global Moderator
      wrote on Jul 29, 2024, 5:24 PM last edited by
      #2

      hm you'd need to have each letter wrapped in an html element to be able to style the letters separately!
      put this in lay options → html at bottom:

      
      <script>
          var text = document.querySelector('.menu-item-97 span').textContent;
          var text_wrapped = text.replace(/\w/g, '<span>$&</span>');
      
          document.querySelector('.menu-item-97 span').innerHTML = text_wrapped;
      </script>
      

      this will lead to markup like this:

      Screenshot 2024-07-29 at 19.21.32.png

      now use css

      .menu-item-97 a>span span:nth-child(1){
          font-weight: 800!important;
      /*instead of font-weight, use font-family: …; CSS*/
      }
      .menu-item-97 a>span span:nth-child(2){
      
      }
      .menu-item-97 a>span span:nth-child(3){
      
      }
      .menu-item-97 a>span span:nth-child(4){
      
      }
      .menu-item-97 a>span span:nth-child(5){
      
      }
      .menu-item-97 a>span span:nth-child(6){
      
      }
      .menu-item-97 a>span span:nth-child(7){
      
      }
      .menu-item-97 a>span span:nth-child(8){
      
      }
      
      1 Reply Last reply
      0
      • D Offline
        D Offline
        danny
        wrote on Jul 30, 2024, 11:02 AM last edited by
        #3

        thanks so much @arminunruh

        Is this right?

        Bildschirmfoto 2024-07-30 um 12.57.42.png

        I included the script. and in css it looks like this:

        }.menu-item-97 a>span span:nth-child(1){
        font-weight: 800!important;
        /instead of font-weight, use font-family: arial1by10-17; CSS/
        }

        Seems it is not applying yet.

        Thanks for the help.
        best, daniel

        1 Reply Last reply
        0
        • A Offline
          A Offline
          arminunruh
          Global Moderator
          wrote on Jul 30, 2024, 2:48 PM last edited by
          #4

          no its wrong

          u probably did this part wrong:

          "put this in lay options → html at bottom:"

          1 Reply Last reply
          0
          • D Offline
            D Offline
            danny
            wrote on Jul 31, 2024, 5:00 PM last edited by
            #5

            so everything goes into in lay options → html at bottom ?

            I did, seems it is not applying.
            I tried as well to have the css in → Custom CSS but it doesn't change anything.

            thanks!

            Bildschirmfoto 2024-07-31 um 18.57.42.png

            F 1 Reply Last reply Aug 1, 2024, 1:12 PM
            0
            • D danny
              Jul 31, 2024, 5:00 PM

              so everything goes into in lay options → html at bottom ?

              I did, seems it is not applying.
              I tried as well to have the css in → Custom CSS but it doesn't change anything.

              thanks!

              Bildschirmfoto 2024-07-31 um 18.57.42.png

              F Offline
              F Offline
              felix_rabe
              wrote on Aug 1, 2024, 1:12 PM last edited by
              #6

              @Danny just put the <script> part in here, the css must go to the "custom css" section. and get rid of the "}" before ".menu-item-97. …"

              1 Reply Last reply
              0
              • D Offline
                D Offline
                danny
                wrote on Aug 2, 2024, 5:09 PM last edited by
                #7

                thanks @felix_rabe I did, still i don't see its applying. Can you see what I'm missing?

                Bildschirmfoto 2024-08-02 um 19.07.52.png

                Bildschirmfoto 2024-08-02 um 19.07.57.png

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  felix_rabe
                  wrote on Aug 2, 2024, 5:36 PM last edited by
                  #8

                  @Danny you have to close every "{" that you opened with a "}". so the one you opened in line 6 misses a closing.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    arminunruh
                    Global Moderator
                    wrote on Aug 4, 2024, 11:50 AM last edited by
                    #9

                    yea the css needs to go to "css", not "html at bottom"

                    just the javascript needs to go into "html at bottom"

                    css: not closing your css statement with a } sign tells me maybe you need to do a basic css course to learn the basics

                    like this tutorial:
                    https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics

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

                    5/9

                    Jul 31, 2024, 5:00 PM


                    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
                    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.
                    5 out of 9
                    • First post
                      5/9
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search