Jump to content

Align Header with left and right margins of content below

Go to solution Solved by Ziggy,

Recommended Posts

You should have more luck if you use percent instead of pixels:

@media only screen and (min-width:768px) {
  .header-title-nav-wrapper .header-title {
    margin-left: 25%;
  }
}
@media only screen and (max-width:767px) {
  .header-title-nav-wrapper .header-title {
    margin-left: 0%;
  }
}

Since the content width is 50% then 25% margin on the left should work nicely. That's not wat you want on mobile so I've added a media query so the code only affects the desktop version, and the mobile version is at 0%.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment

Here's some updated code:

@media only screen and (min-width:768px) {
  .header-title-nav-wrapper .header-title {
    margin-left: 25%;
  }
  .header-layout-nav-right .header-nav-list {
    margin-right: 24vw;
  }
}
@media only screen and (max-width:767px) {
  .header-title-nav-wrapper .header-title {
    margin-left: 0%;
  }
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution

Though frankly this would be better:

@media only screen and (min-width:768px) {
  .header-width-inset .header-inner {
    max-width: 900px;
    width: 50%;
  }
}
@media only screen and (max-width:767px) {
  .header-title-nav-wrapper .header-title {
    margin-left: 0%;
  }
}

Sorry, I misunderstood your first request (that's on me!)

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.