Jump to content

Mysterious gap in mobile navigation

Go to solution Solved by tuanphan,

Recommended Posts

My website is kofiperry.com

I'm trying to style my navigation menu in the mobile version of my site to look vertically aligned with the text on my "about/contact" page. As of now I can't get it to go left enough, and the words "about/contact" are somehow further right of the "selected works" link above it. Could anyone please help? I've tried messing with spacing in my site styles and adjusting margins/padding in my custom css codes. I suspect one block of code is the culprit:

 

Quote

@media screen and (max-width:1024px) {
.header-nav {
   display: flex !important;
    margin-right: 90% !important;
    margin-left: auto !important;
}
.header-burger {
    display: none !important;
}

 

Link to comment
  • Replies 4
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hmm, that's not what I get on mobile. These pictures show what I see on my phone. I want the bottom line "about/contact" to be in the same line as "selected works", and for both of them to be in the same line as the first words of my bio.  

 

This is all the code I have

 

Quote

/* remove portfolio pagination */
.item-pagination[data-collection-type^="portfolio"], .item-pagination[data-collection-type^="portfolio"] {
    display: none;
}
div.portfolio-text {
    display: none;
}
div.header-nav-item--active a {
    background-image: none !important;
}
.header-nav-folder-item--active .header-nav-folder-item-content {
  background: none !important;
}
@media screen and (max-width:1024px) {
.header-nav {
   display: flex !important;
    margin-right: 90% !important;
    margin-left: auto !important;
}
.header-burger {
    display: none !important;
}
a#site-title {
    white-space: nowrap; max-width: 50px
}
}
/* Float header */
@media screen and (min-width:992px) {
  .header-title {
    position: fixed;
    top: 4vw;
    left: 5vw;
    z-index: 9999;
}
.header-nav {
    position: fixed;
    top: 15%;
    left: 10%;
    padding: 0 !important;
    transform: translateY(-90%);
}
  nav {
    flex-direction: column;
  }
  div.header-nav-item {
    margin: 0 !important;
    text-align: left !important;
}
  div.header-nav-item  a{
   display: inline-block;
}
.header-actions.header-actions--right {
    position: fixed;
    left: 1vw;
    bottom: 5vw;
    justify-content: flex-start !important;
}
.header-actions--right .header-actions-action a {
    margin-left: 0 !important;
    margin-right: 2.5vw;
}
}
.header-title {
   display: none !important;
}

 

IMG_5029.jpg

IMG_5029 2.jpg

Link to comment
  • Solution

You can use this code to Custom CSS box

@media screen and (max-width:767px) {
.header-nav-item.header-nav-item--collection {
    margin-left: 0px !important;
}

nav.header-nav-list {
    justify-content: flex-start !important;
}
}

image.png.83d44da8b73835d9ee11337e713c66b9.png

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.