Jump to content

[Share] Change Order of Navigation on One Page

Recommended Posts

To change the order of navigation on One Page, you need to do these.

#1. First, find Page ID. 

In my example, we have: #collection-6673f2e18432c25013aee99f

image.png.ee084aceb7eedeed14abe7d4e731afd5.png

#2. You need to know this

  • First item (Book Now): nth-child(1)
  • Second item (Home): nth-child(2)
  • ...

image.png.fadd2aa1535259bc29f50dd586804859.png

#3. Suppose we need to change the order to this: Home, Projects, Canva, Pages, Sections, Blocks, Book Now, Search

We will use this code to Custom CSS box

#collection-6673f2e18432c25013aee99f {
  /* Home */
div.header-nav-item:nth-child(2) {
    order: 1;
}
/* Projects */
div.header-nav-item:nth-child(8) {
     order: 2;
}
/* Canva */
div.header-nav-item:nth-child(3) {
     order: 3;
}
/* Pages */
div.header-nav-item:nth-child(7) {
     order: 4;
}
/* Sections */
div.header-nav-item:nth-child(5) {
     order: 5;
}
/* Blocks */
div.header-nav-item:nth-child(6) {
     order: 6;
}
/* Book Now */
div.header-nav-item:nth-child(1) {
     order: 7;
    margin-left: 2.1vw;
}
/* Search */
div.header-nav-item:nth-child(4) {
    order: 8; 
}}

image.thumb.png.e5de64029751b99c203789a4dffb85d1.png

#4. Result

image.png.27e8bab727a27f37ad7c5e126b7b8b84.png

#5. To change order on Desktop + Mobile, use this code

#collection-6673f2e18432c25013aee99f {
/* general */
.header-menu-nav-wrapper {
    display: flex;
    flex-direction: column;
}
div.container.header-menu-nav-item {
     margin-left: 0px !important;
}
/* Home */
div.header-nav-item:nth-child(2), div.container.header-menu-nav-item:nth-child(2) {
    order: 1;
}
/* Projects */
div.header-nav-item:nth-child(8), div.container.header-menu-nav-item:nth-child(8) {
     order: 2;
}
/* Canva */
div.header-nav-item:nth-child(3), div.container.header-menu-nav-item:nth-child(3) {
     order: 3;
}
/* Pages */
div.header-nav-item:nth-child(7), div.container.header-menu-nav-item:nth-child(7) {
     order: 4;
}
/* Sections */
div.header-nav-item:nth-child(5), div.container.header-menu-nav-item:nth-child(5) {
     order: 5;
}
/* Blocks */
div.header-nav-item:nth-child(6), div.container.header-menu-nav-item:nth-child(6) {
     order: 6;
}
/* Book Now */
div.header-nav-item:nth-child(1), div.container.header-menu-nav-item:nth-child(1) {
     order: 7;
    margin-left: 2.1vw;
}
/* Search */
div.header-nav-item:nth-child(4), div.container.header-menu-nav-item:nth-child(4) {
    order: 8; 
}}

image.png.1bd9522f8bc1fb9cc07a66703d0eb3f3.png

#6. To change order on Mobile only, use this code

#collection-6673f2e18432c25013aee99f {
/* general */
.header-menu-nav-wrapper {
    display: flex;
    flex-direction: column;
}
/* Home */
div.container.header-menu-nav-item:nth-child(2) {
    order: 1;
}
/* Projects */
div.container.header-menu-nav-item:nth-child(8) {
     order: 2;
}
/* Canva */
div.container.header-menu-nav-item:nth-child(3) {
     order: 3;
}
/* Pages */
div.container.header-menu-nav-item:nth-child(7) {
     order: 4;
}
/* Sections */
div.container.header-menu-nav-item:nth-child(5) {
     order: 5;
}
/* Blocks */
div.container.header-menu-nav-item:nth-child(6) {
     order: 6;
}
/* Book Now */
div.container.header-menu-nav-item:nth-child(1) {
     order: 7;
}
/* Search */
div.container.header-menu-nav-item:nth-child(4) {
    order: 8; 
}}

#7. In case you use Burger Menu on the Desktop, to change order on Mobile only, use this code

@media screen and (max-width:767px) {
#collection-6673f2e18432c25013aee99f {
/* general */
.header-menu-nav-wrapper {
    display: flex;
    flex-direction: column;
}
/* Home */
div.container.header-menu-nav-item:nth-child(2) {
    order: 1;
}
/* Projects */
div.container.header-menu-nav-item:nth-child(8) {
     order: 2;
}
/* Canva */
div.container.header-menu-nav-item:nth-child(3) {
     order: 3;
}
/* Pages */
div.container.header-menu-nav-item:nth-child(7) {
     order: 4;
}
/* Sections */
div.container.header-menu-nav-item:nth-child(5) {
     order: 5;
}
/* Blocks */
div.container.header-menu-nav-item:nth-child(6) {
     order: 6;
}
/* Book Now */
div.container.header-menu-nav-item:nth-child(1) {
     order: 7;
}
/* Search */
div.container.header-menu-nav-item:nth-child(4) {
    order: 8; 
}}}

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
  • Replies 0
  • Views 728
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

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.