giorgiasage Posted September 7, 2023 Posted September 7, 2023 (edited) url: https://sheep-green-4e8l.squarespace.com/ site pw: kilter I used some helpful code to target the first 3 nav links to turn them into buttons. Now, I want to target them (in this case, 2 + 3) to change their margin to 1vw instead of the 2vw on the other links. The :nth-child code I used to target the anchor elements isn't working for the padding. I need to target the class .header-nav-item--external but can't quite figure it out. Can anyone help? Much appreciated. Edited September 7, 2023 by giorgiasage missing link
Lesum Posted September 7, 2023 Posted September 7, 2023 @giorgiasage Would it be possible to share your site URL so I can take a look? Thanks! If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
giorgiasage Posted September 7, 2023 Author Posted September 7, 2023 @Lesum so sorry! i didn't mean to leave it out. here: https://sheep-green-4e8l.squarespace.com/ thanks so much! i know it's probably a simple line of code, i'm just unfamiliar with the syntax.
Solution Lesum Posted September 7, 2023 Solution Posted September 7, 2023 (edited) @giorgiasage Did you want to change the margin to 1vw only for the buttons? If so, you can add this code snippet: .header-nav-item.header-nav-item--external:nth-child(2) { margin-left: 1vw !important; } .header-nav-item.header-nav-item--external:nth-child(3) { margin-left: 1vw !important; } Otherwise, if you want to change the margin for all navigation items, you can add this code snippet: .header-layout-nav-right .header-nav-item:not(:first-child):not(.header-actions-action--cart) { margin-left: 1vw !important; } Edited September 8, 2023 by Lesum Taylor_Design 1 If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment