Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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. bar to separate menu elements

bar to separate menu elements

Scheduled Pinned Locked Moved General Discussion
9 Posts 3 Posters 677 Views 2 Watching
  • 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.
  • E
    E
    emmapasteur
    wrote on last edited by
    #1

    Hi ! Do you have an idea how I could add vertical bars to separate the elements of my menu as shown on the image ?
    I tried to add it before the words but as every element is independant the bar is never centered...

    Thank you vm

    Capture d’écran 2026-05-22 à 11.05.20.png

    1 Reply Last reply
    0
    • emgeofficeE
      emgeofficeE
      emgeoffice
      wrote on last edited by
      #2

      Have you added it via css?

      1 Reply Last reply
      0
      • E
        E
        emmapasteur
        wrote on last edited by
        #3

        I tried yes... but as i said i can't manage to center it between the words

        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by arminunruh
          #4
          <script>
          (function () {
          	var lists = document.querySelectorAll('nav.laynav.primary > ul');
          	for (var i = 0; i < lists.length; i++) {
          		var ul = lists[i];
          		// collect the real menu items (excluding dividers)
          		var items = [];
          		for (var c = 0; c < ul.children.length; c++) {
          			var child = ul.children[c];
          			if (child.tagName === 'LI' && !child.classList.contains('lay-menu-divider')) {
          				items.push(child);
          			}
          		}
          		// insert a divider before every menu item except the first
          		for (var j = 1; j < items.length; j++) {
          			var prev = items[j].previousElementSibling;
          			if (prev && prev.classList.contains('lay-menu-divider')) {
          				continue; // divider already there
          			}
          			var divider = document.createElement('li');
          			divider.className = 'lay-menu-divider';
          			divider.setAttribute('aria-hidden', 'true');
          			ul.insertBefore(divider, items[j]);
          		}
          	}
          })();
          </script>
          
          <style>
          /* Vertical divider line between menu items (JS-inserted <li>) */
          nav.laynav.primary > ul > li.lay-menu-divider {
          	display: inline-block;
          	vertical-align: middle;   /* vertically centered on the menu line */
          	width: 1px;               /* line thickness */
          	height: 15px;             /* line height */
          	margin: 0 2px;           /* space left/right → breathing room from the text */
          	padding: 0;
          margin-top: 5px;
          	background-color: #000;   /* black */
          }
          </style>
          

          copy this and put it into "html at bottom"

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

            then you can adapt the CSS so the line has the right height and spacing.

            grafik.png

            Try to adapt the CSS using maybe ChatGPT or Gemini or something if you need help with that

            1 Reply Last reply
            0
            • E
              E
              emmapasteur
              wrote on last edited by
              #6

              I can't find the "html at bottom" window you are talking about... thank you very much for your help

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

                I changed the code a little bit. I had one or two things that were not optimal yet. You can copy the code again from my post above.

                You will find it in Lay Options . Custom HTML and CSS, and I think it's the very last text box at the bottom.

                1 Reply Last reply
                0
                • E
                  E
                  emmapasteur
                  wrote on last edited by
                  #8

                  Thank you so much.

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

                    you're welcome! <3

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    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.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search