Jump to content

Archived

This topic is now archived and is closed to further replies.

selmakdesign

issue with nav bar hover CSS

Recommended Posts

selmakdesign

Hello,

 

I know my way around CSS pretty well, but I cannot find a way of changing the navbar CSS on hover. The predifined style has an animated underline, but what I would like is no underline and an animated icon to the left at hover, now I have both see second image.
Can you please help me with the code to accheive this? This is code I have so far (I've tried using no border without results):

.section-navbar .navbar .navline > li > a { 
  text-indent: 25px;
  height:18px;
  width:auto;
  padding: 0 30px 0 0;
  background-image:url('http://www.body-foods.com/wp-content/uploads/2014/10/nav-sprite.png');
  background-position:0px 0px;
  background-repeat: no-repeat !important;
} 
.section-navbar .navbar.pl-color-base .navline > li > a:hover {
  background-position:0px -18px !important;

}

navbar.png

navbar_hover.png

Share this post


Link to post
Share on other sites
Danny

Hi,

 

You will want to use the following:

 

#site .section-navbar .navbar .navline > li > a {
  color: #fff;
}
 
#site .section-navbar .navbar .navline > li > a:hover {
  color: #fff;
  background: #008000;
}
 
Also, can you provide a link to the site in question, as the NavBar in DMS 2.x shouldn't have any hover line at the bottom, this was in DMS 1.x and was caused by box-shadow, if you add box-shadow: none; it should resolve the issue.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
selmakdesign

Thanks Danny, why didn't I think of box-shadow!   :P

 

I purchased DMS2 and also updated it just a couple of days ago so not sure why the underline is a standard. Actually also note how the underline is still there when pointing the mouse under the text, and my custom css appears when hovering over the text. I've used an unordered list in a textbox as navigation for now but you'll see the included navbar just above the footer of the page:

 

http://www.body-foods.com/

 

navbar_basecolor.jpg

Share this post


Link to post
Share on other sites
Danny

The box shadow appears when you use the Base color, it won't appear if you use any of the other styles. To remove the box shadow add the following:

 

#site .section-navbar .navbar.pl-color-base .navline > li:hover > a,
#site .section-navbar .navbar.pl-color-base .navline > li.current-menu-item > a,
#site .section-navbar .navbar.pl-color-base .navline > li.dropdown.open > a {
  box-shadow: none;
}

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

No problem.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
selmakdesign

Here's an update to an old question, the absolute best way of customizing the NavBar section (mostly a note to self for future ref)

Set any color for the navbar (base, black, blue..) Which one is not important, if you don't want the underline, don't use the base color that's all.

Now customize using the following classes : 

#site .navbar

Example:

#site .navbar {
  font-size: 1.6em;
  font-family: "Petrona";
  font-weight: 400;
  text-transform: uppercase;
  color: #fff;
  background-color: transparent;
  box-shadow: none;
  border-top: none;
}

#site .navbar a:hover {
  color: #5a5a5a;
  background-color: transparent;
}

There's no need to use the "complicated" classes found when using chrome or firefox developer tools (#site .section-navbar .navbar .navline > li > a),

Share this post


Link to post
Share on other sites

  • Similar Content

    • glyph.marketing
      By glyph.marketing+
      Hello, I am having a problem similar to that experienced by Michael Kummer here. We have pages that show this automatic scrolling issue (examples here and here) and it is sufficiently annoying that we have seen customers bounce while trying to convert. Strangely, it only happens at specific resolutions, so it can be difficult to reproduce. In general we can only consistently reproduce it on a 4k resolution with a browser width between 1517 and 1536px. 
      Thanks to Michael Kummer's help we were able to set the overflow-anchor property to none in the entire body, which fixed the issue as far as we can tell, but also obviously disabled scroll anchoring for the whole site. I tried applying it to the specific element that looked like it was being reloaded, which was the PL Meganav extension, but that was unsuccessful. 
      Can anyone help us figure out which element or ID we can apply this property to, so that we can fix the scrolling issue but not disable scroll anchoring for the entire site?
      Thank you - 
      Glyph Language Services
    • Liv Kundalini
      By Liv Kundalini+
      Hi -
      Pulling my hair out over here, and would love an assist!
      Site I am building, http://www.livkundalini.com/home, has a problem with the submenu items in the nav not appearing. 
      If anyone wants to see what the Nav should look like, feel free to look in the footer on the left hand side.
      Have tried disabling Pagelines and using the twentyseventeen theme, but problem persists.
      Saw this error (pasted at the bottom of this post) displaying in the inspector, and saw discussion of Jetpack potentially being a culprit. Disabled Jetpack, but the problem persists.
      Had the hosting company even flush the server-side cache, but no avail.
      Any thoughts? Please? It's the only thing keeping me from launching this site!
      Many Thanks,
      Todd
       
      WebSocket connection to 'wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data' failed: Error during WebSocket handshake: Unexpected response code: 403   O @ (index):7
    • chamois_blanc
      By chamois_blanc+
      Hello,
      Shouldn't the image PL5 component be using the srcset/picture css directives to pick the correct size for an image? or it does already and I don't know how to use it? Thank you for any advice or enlightenment.
    • Dan Haddock
      By Dan Haddock
      Plugins Active and installed: 
      Akismet Anti-Spam
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools  
      Enhanced Media Library  
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap
      Jetpack by WordPress.com
      Legull 
      Loginizer   
      MailChimp for WordPress
      PageLines Updater    
      Schema App Structured Data 
      Sucuri Security - Auditing, Malware Scanner and Hardening
      Uber reCaptcha    
      Yoast SEO
      Wordpress Version: 4.8.1
      Pagelines Version: 2.2.4
       
      Good Evening/Afternoon or Morning, 
      I am running into a problem with CSS styling not applying inside of most browsers (Safari, Firefox) when I am logged in to wordpress, and all browsers that I have tested when I am logged off and the site has been made public (Chrome, Firefox and Safari).
      As a result, I have managed to identify the probable cause. It looks as though these browsers are refusing to render my sites compiled CSS file due to it being a HTTP URL rather than HTTPS.
      I have attempted to change this URL to HTTPS in my browser, however it brings back an ERROR: File not found page - https://www.shortfilmblog.com/wp-content/uploads/pagelines/compiled-css-core-1505847507.css
      What would you suggest in this regard? Would this be resolvable from your end?
      Happy to provide any further details required.
    • Borries
      By Borries+
      I know this is not an easy problem. Maybe there is a easy solution.
      I have tryed to uses the existing solution, that I have found in the forum
      I changed the colours of my nav (simple nav) and the hover effect (a. hover).
      I really tryed to highlight the active/used link in the nav but I cant figure it out.
      I want it to be black when active.
      Any help would be appreciated. Thanks.
      http://www.marcborries.de  nav link: "Sinn & Selbst" 
×