How can I add a line to header links that changes color on different pages?

Solved

How can I add a line to header links that changes color on different pages?

sweetchin23
Excursionist
43 0 6

hello, can anyone help me on how to achieve this?
I want to put a line on the links like that in the header and when in other pages it will turn to be black.

Thank you!

 

Screen Shot 2023-11-17 at 8.40.41 AM.png

Accepted Solution (1)
websensepro
Shopify Partner
1221 136 156

This is an accepted solution.


@sweetchin23 wrote:

thank you, but can i extend the width until the icon?


nav.header__inline-menu:after {
    position: absolute;
    content: "";
    height: 2px;
    background-color: white;
    width: 79%;
    top: 71%;
    left: 19%;
}

 

websensepro_1-1700231122640.png

 

 

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial

View solution in original post

Replies 8 (8)

Moeed
Shopify Partner
5516 1496 1786

Hey @sweetchin23 

 

Could you please provide your Store URL and, if applicable, the Password too? Your cooperation is greatly appreciated!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Custom Design | Advanced Coding | Store Modifications


sweetchin23
Excursionist
43 0 6

alright thank you

Moeed
Shopify Partner
5516 1496 1786

Hey @sweetchin23 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
nav.header__inline-menu {
    border-bottom: solid 2px white;
}
</style>

RESULT:

Moeed_0-1700229037667.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Custom Design | Advanced Coding | Store Modifications


sweetchin23
Excursionist
43 0 6

thank you, but can i extend the width until the icon?

websensepro
Shopify Partner
1221 136 156

This is an accepted solution.


@sweetchin23 wrote:

thank you, but can i extend the width until the icon?


nav.header__inline-menu:after {
    position: absolute;
    content: "";
    height: 2px;
    background-color: white;
    width: 79%;
    top: 71%;
    left: 19%;
}

 

websensepro_1-1700231122640.png

 

 

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial
sweetchin23
Excursionist
43 0 6

Oh wow! Thank you! It is perfect, but I also have another question, is it possible to make it black when I change to another page? Like this? Thank you so much!

 

Screen Shot 2023-11-17 at 9.30.35 AM.png

websensepro
Shopify Partner
1221 136 156

Yes it possible

If this solution worked for you, please mark it as resolved.

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here

Free Shopify Beginner Tutorial
sweetchin23
Excursionist
43 0 6

Thank you, i will just put it in my theme.liquid and make it !=index right?