Jump to content

How to centre navigation dividers

Go to solution Solved by LightandShapes,

Recommended Posts

Hi,

I am setting up my website and added website dividers with the code:

Quote

// Blue Square Nav Dividers //
.header-nav-item a:after {
  content: "◼";
  margin-left: 22px;
  color: #3195b3;
  font-size: 15px
}
div.header-nav-item:last-child>a:after {
    visibility: hidden;
}
// Remove Slash From Folder Nav //
.header-nav .header-nav-item--folder .header-nav-folder-content .header-nav-folder-item a:after {
  content: "" !important;
}
// Remove Active Nav Line //
.header-nav-item--active a {
    background-image: none !important;
}

I am struggling to get the dividers to display exactly centre. Can anyone help, please?

Site: http://trout-finch-fxgz.squarespace.com

Password: centrenav

Thank you,

 

Edited by LightandShapes
Missed website link.
Link to comment
  • Replies 5
  • Views 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

Try something like the following.

// Blue Square Nav Dividers //
.header-nav-item a:after {
  content: "◼";
  margin-left: 1vw;
  color: #3195b3;
  font-size: 15px
}
div.header-nav-item:last-child>a:after {
    visibility: hidden;
}
// Remove Slash From Folder Nav //
.header-nav .header-nav-item--folder .header-nav-folder-content .header-nav-folder-item a:after {
  content: "" !important;
}
// Remove Active Nav Line //
.header-nav-item--active a {
    background-image: none !important;
}

.header-layout-branding-center-nav-center .header-title-nav-wrapper .header-nav .header-nav-item{
    margin-left: 0px !important;
}

 

If an answer I provide helps you, please mark it as the answer so others can easily access it as well.

I'm a Squarespace Authorized TrainerSquarespace Expert, and Circle Member and I've been helping my clients as well as those here in the forum and in various Squarespace groups with custom coding and support for Squarespace websites. I would love to help you in any way I can.

Squarespace PluginsBook Live Help | Squarespace Video Tutorials | Buy Me a Coffee

Link to comment
17 hours ago, Vigasan said:

Try something like the following.

// Blue Square Nav Dividers //
.header-nav-item a:after {
  content: "◼";
  margin-left: 1vw;
  color: #3195b3;
  font-size: 15px
}
div.header-nav-item:last-child>a:after {
    visibility: hidden;
}
// Remove Slash From Folder Nav //
.header-nav .header-nav-item--folder .header-nav-folder-content .header-nav-folder-item a:after {
  content: "" !important;
}
// Remove Active Nav Line //
.header-nav-item--active a {
    background-image: none !important;
}

.header-layout-branding-center-nav-center .header-title-nav-wrapper .header-nav .header-nav-item{
    margin-left: 0px !important;
}

 

Hi,

 

Thank you for your response. This worked perfectly for the first divider, however the following two are still off centre. Are you able to help with this please?

Link to comment
  • Solution

Yes.

I specifically targeted the out of centre divider spacing in the code and nudged them.

Here is the code I utilised if anybody comes across this issue desiring a solution:

Quote

// Blue Square Nav Dividers //
.header-nav-item a:after {
  content: "◼";
  margin-left: 0.47vw;
  color: #3195b3;
  font-size: 16px
}
// First Divider Spacing //
div.header-nav-item:first-child>a:after {
   margin-left: 1vw;
}
// Third Divider Spacing //
div.header-nav-item:nth-child(3)>a:after
{
   margin-right: -1.4px;
}
// Hide Last Divider //
div.header-nav-item:last-child>a:after {
    visibility: hidden;
}
// Remove Slash From Folder Nav //
.header-nav .header-nav-item--folder .header-nav-folder-content .header-nav-folder-item a:after {
  content: "" !important;
}
// Remove Active Nav Line //
.header-nav-item--active a {
    background-image: none !important;
}
// Centre Navigation Dividers //
.header-layout-branding-center-nav-center .header-title-nav-wrapper .header-nav .header-nav-item{
    margin-left: 0px !important;
}

 

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.