BYWJ Posted May 10 Posted May 10 I am trying to center 1 navigation item in particular. I know I'll have to use code, but I have no experience creating code. I don't want to change how I have the order of the navigation items set up (nav items, logo, social icons, etc). Only the search icon in particular. The navigation item in particular is the search icon. I want it to be centered (in the green circle, not centered as in next to my logo). I appreciate any help! Thanks, Julie
tuanphan Posted May 10 Posted May 10 Can you share site url? We can check easier. BYWJ 1 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!)
tuanphan Posted May 12 Posted May 12 You can try this to Website > Website Tools > Custom CSS nav.header-nav-list { position: relative; justify-content: space-between; } nav.header-nav-list>div:nth-child(7) { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; } 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!)
BYWJ Posted May 12 Author Posted May 12 I added the code and this is what it looks like I had to change this part of the code: nav.header-nav-list>div:nth-child(7) { To this: nav.header-nav-list>div:nth-child(6) { Because I combined a navigation item into a folder (Coaching > Lifestyle folder), and 7 didn’t exist anymore. All it needs right now is to be moved to the next line, any idea on how to do that? Thanks, Julie
tuanphan Posted May 18 Posted May 18 It already fine to me 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!)
Solution BYWJ Posted May 20 Author Solution Posted May 20 For anyone wondering I used this code to fix it nav.header-nav-list > div:nth-child(6) { /* Remove absolute positioning and transformation */ width: 100%; /* Make it occupy the full width of the new row */ text-align: center; /* Center the item horizontally */ margin-top: 2px; /* Add some spacing above the new row (adjust as needed) */ } (Change "6" with whatever number your navigation item is. For example, if you have 3 navigation items "Shop, Contact, About" and you're trying to move "About" you'd change the 6 in the code to 3, since its the 3rd navigation item)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment