Nshephard Posted February 5, 2022 Share Posted February 5, 2022 Site URL: https://onh.community Hello! I'm using this custom CSS to create a hover state for the links in my header and mobile menu, but the hover state is now also showing up for the social links in my footer which I'd like to remove. Any suggestions for how to do so? Thanks! //LINK HOVER STATE nav a:hover { background-size: 100% 1.5px !important; } nav a { padding-bottom: 6px; overflow: visible !important; background-repeat: no-repeat !important; background-image: linear-gradient(to right,currentColor 100%,currentColor 0) !important; background-size: 0% 0.5px !important; background-position: 0% 100% !important; white-space: initial; transition: all ease-in-out 500ms !important; -ms-transition: all ease-in-out 500ms !important; -moz-transition: all ease-in-out 500ms !important; -webkit-transition: all ease-in-out 500ms !important; } .header-menu-nav-item a { display: inline-block; } //End navigation underscore// Link to comment
creedon Posted February 6, 2022 Share Posted February 6, 2022 The issue is because the nav elements you are targeting are used in the header and in the footer for the social icons. Replace (make a copy somewhere) your code with the following. .header-nav-wrapper a, /* desktop */ .header-menu-nav-item a /* mobile */ { background-image : linear-gradient( to right, currentColor 100%, currentColor 0 ); background-position : 0% 100%; background-repeat : no-repeat; background-size : 0% .5px; overflow : visible; padding-bottom : 6px; -ms-transition : all ease-in-out 500ms; -moz-transition : all ease-in-out 500ms; -webkit-transition : all ease-in-out 500ms; transition : all ease-in-out 500ms; white-space : initial; } .header-nav-wrapper a:hover, /* desktop */ .header-menu-nav-item a:hover /* mobile */ { background-size : 100% 1px; } .header-menu-nav-item a /* mobile */ { display : inline-block; } Let us know how it goes. tuanphan 1 Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
Nshephard Posted February 6, 2022 Author Share Posted February 6, 2022 It worked! Thank you so much and thanks for explaining why it was doing it- really appreciate it! creedon 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment