Jump to content

Mobile Menu Nav - Counter

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://www.orsolyaoszabo.com/home

Hello, Thanks if anyone can help,

I managed to add counters to the desktop navigation links, with css. Like photos no. 1

I used this code: 

 

 .header-nav-list>.header-nav-item:before {
    content: "0" counter(menu-item-counter) "./";
    font-family: proxima-nova;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #272724;
    position: ;
    top: -10px;
    left: 65px
}
  .header-nav-list>.header-nav-item {
    counter-increment: menu-item-counter;
    position: relative;
}

.header-nav-list {
    counter-reset: menu-item-counter;
    justify-content: flex-start;
}

And I wanna do the same, on mobile, but I only got 01. before each nav item with almost the same code. (photo no. 2)

.header-menu-nav-item a:before {
    content: "0" counter(menu-item-counter) "./";
    font-family: proxima-nova;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #272724;
    position: ;
    top: -10px;
    left: 65px
}
 .header-menu-nav-item a {
    counter-increment: menu-item-counter;
    position: relative;
}
.header-menu-nav-item a {
    counter-reset: menu-item-counter;
    justify-content: flex-start;
}

Huge thanks to anyone who can tell me what's wrong, and how to make the nav links actually counting!!

Orsi

Screenshot 2022-10-17 at 8.54.58.png

IMG_1120.PNG

Link to comment
  • Solution

Use this code for mobile

.header-menu-nav-item:before {
    content: "0" counter(menu-item-counter) "./";
    font-family: proxima-nova;
    font-style: normal;
    font-weight: 400;
    font-size: .625rem;
    line-height: 1.2em;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #272724;
    position: ;
    top: -10px;
    left: 65px
}
 .header-menu-nav-item {
    counter-increment: menu-item-counter;
    position: relative;
}
.header-menu-nav-folder[data-folder="root"]>div {
    counter-reset: menu-item-counter;
    justify-content: flex-start;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.