Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
greeniglu

How to freeze Navigation Item Link when reducing/expanding window size

Question

Site URL: https://bassoon-oleander-texb.squarespace.com/

Site password: 12345

Right now, I have a "SHOP" Button in my navigation bar that I moved closer to the Cart icon using CSS edits to its spacing. However, when the window size is reduced/expanded, it moves with the other navigation items and the spacing I'm looking for gets messed up.

I've currently used multiple lines to edit the spacing based off the window size as a basic fix: 

@media only screen and (min-width: 1270px){.header-nav-item:nth-child(5){
  margin-left: 280px !important;
  margin-right: 5px !important;
  padding-right: 10px !important;}}

@media only screen and (max-width: 1270px){.header-nav-item:nth-child(5){

margin-left: 200px !important;
  margin-right: 5px !important;
  padding-right: 10px !important;}}

@media only screen and (max-width: 1200px){.header-nav-item:nth-child(5){
  margin-left: 180px !important;
  margin-right: 5px !important;
  padding-right: 10px !important;}}

etc....

However, I'm wondering if there is an easier fix to this and have that particular nav item (SHOP) behave like the Cart icon and Donate Button when the window size is expanded/reduced - so that it remains right-aligned to the window in the same relative position. Same thing when it comes to the grey backdrop. 

Any and all help would be greatly appreciated!

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 0
On 4/11/2020 at 4:26 AM, tuanphan said:

Try


@media screen and (min-width:992px) {
.header-nav-list {
    width: 100%;
}
.header-nav-item:nth-child(5) {
    flex: 10%;
    text-align: right;
    padding-right: 10px;
}
}

 

This did the trick! Thank you so much!

Share this post


Link to post
  • 0
On 4/11/2020 at 4:26 AM, tuanphan said:

Try


@media screen and (min-width:992px) {
.header-nav-list {
    width: 100%;
}
.header-nav-item:nth-child(5) {
    flex: 10%;
    text-align: right;
    padding-right: 10px;
}
}

 

@tuanphan 
 

Once again, thank you very much for the help! One quick question! The link now stretches from its current position (aligned right) to where its original position would be (next to the rest of the nav items), so that when you scroll over the area to the left of the text, the link is still active.

Do you happen to have a fix for this?

Share this post


Link to post
  • 0
13 hours ago, greeniglu said:

@tuanphan 
 

Once again, thank you very much for the help! One quick question! The link now stretches from its current position (aligned right) to where its original position would be (next to the rest of the nav items), so that when you scroll over the area to the left of the text, the link is still active.

Do you happen to have a fix for this?

Not sure I understand your mean, or did you fix?


You can send your question to my email to get faster answer.

How to Setup Password & Share URL  Armadillo - Free portfolio template

Share this post


Link to post
  • 0
43 minutes ago, tuanphan said:

Not sure I understand your mean, or did you fix?

@tuanphan

No fix as of yet!

The screenshot attached will show you. The link is activated even when the cursor hovers over the blank space to the left of it

Screen Shot 2020-04-21 at 10.39.28 AM.png

Share this post


Link to post
  • 0
15 minutes ago, greeniglu said:

@tuanphan

No fix as of yet!

The screenshot attached will show you. The link is activated even when the cursor hovers over the blank space to the left of it

 

Add to Home > Design > Custom CSS

.header .header-nav-wrapper a[href="/shop"] {
    display: inline-block;
}

 


You can send your question to my email to get faster answer.

How to Setup Password & Share URL  Armadillo - Free portfolio template

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...