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. change font size for two menu points in mobile-menu

change font size for two menu points in mobile-menu

Scheduled Pinned Locked Moved General Discussion
6 Posts 2 Posters 185 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.
  • F Offline
    F Offline
    florine
    wrote on last edited by
    #1

    Hi!

    I would like to appear 2 menupoints smaller in the mobile menu than the rest and change their color and font style.
    I tried to do this in the 'css for Mobile Version' section of lay theme-options with the following code:

    nav.laynav {
    font-family: "ABCDiatype-Regular";
    font-size: 17px; !important;
    }
    
    .menu-item-6969 {
        font-family: "ABCDiatype-RegularItalic";
    font-size: 12px; !important;
    color: white;
    }
    
    .menu-item-6968 {
        font-family: "ABCDiatype-RegularItalic";
    font-size: 12px; !important;
    color: white;
    }
    

    This did work out for the font style, but not for the size and the color.
    Can you tell me why / what I have to do?

    I also did put up settings in 'Costumize' > 'Mobile Menu', where I defined the font size for the menupoints on 17px. Maybe this is where the problem parts from?

    this is the website I am working on:
    https://tanzhausbern.ch/on-stage/

    Thanks for your help
    Florine

    1 Reply Last reply
    0
    • arminunruhA Online
      arminunruhA Online
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      there is an error in your css:

      Screenshot 2022-07-29 at 16.19.12.png

      it needs to be:
      font-size: 12px!important;

      1 Reply Last reply
      0
      • F Offline
        F Offline
        florine
        wrote on last edited by
        #3

        Dear Armin
        Oh, sorry!

        I changed that and it still doesn't work for the font size though
        my css now is:

        nav.laynav {
        font-family: "ABCDiatype-Regular";
        font-size: 17px;
        }
        
        .menu-item-6969 {
            font-family: "ABCDiatype-RegularItalic";
        font-size: 12px!important;
        }
        
        .menu-item-6968 {
            font-family: "ABCDiatype-RegularItalic";
            font-size: 12px!important;
        }
        

        it's really strange that it accepts the font-family but not the size.
        Hope there is not another error in the code...
        Thanks for helping!

        1 Reply Last reply
        0
        • arminunruhA Online
          arminunruhA Online
          arminunruh
          Global Moderator
          wrote on last edited by arminunruh
          #4

          Screenshot 2022-07-30 at 11.09.55.png

          your css targets:
          .menu-item-6969 {}

          but my css as you can see in the screenshot above targets:
          nav.mobile-nav li a

          my css has precedence because the selector is more specific.
          read about it here:
          https://jenkov.com/tutorials/css/precedence.html

          this should work:

          nav.mobile-nav li.menu-item-6969 a {
              font-family: "ABCDiatype-RegularItalic";
              font-size: 12px!important;
          }
          
          nav.mobile-nav li.menu-item-6968 a {
              font-family: "ABCDiatype-RegularItalic";
              font-size: 12px!important;
          }
          
          1 Reply Last reply
          0
          • arminunruhA Online
            arminunruhA Online
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            also, you can add css classes to menu points and use them instead of targeting the menu points individually in appearance -> menus:
            Screenshot 2022-07-30 at 11.14.17.png

            1 Reply Last reply
            0
            • F Offline
              F Offline
              florine
              wrote on last edited by
              #6

              Dear Armin

              Great, now it works! Thank you so much!

              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
              arminunruhA
              arminunruh
              F
              francesco
              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