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

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I have noticed that my primary sidebar becomes intermittently invisible when browsing through various blog articles on michaelkummer.com/blog.
      See:
      https://www.dropbox.com/s/z646sgoa3mfjl1j/Screenshot 2018-07-12 15.57.46.jpg?dl=0 and https://www.dropbox.com/s/vdledzzgginvwgv/Screenshot 2018-07-12 15.57.57.jpg?dl=0
      Upon refresh, the sidebar appears. I have been using the following CSS code to hide the sidebar on mobile without any issues. 
      @media only screen and (max-width: 993px) {
      /* hide sidebars */
           .plsb {
              display: none !important;
          }
      }
      I tried to add the following CSS to force the sidebar to show on screens that are wider than 994 pixels but to no avail. Any clue what could be causing this issue?
    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using the LESS/CSS Pagelines extension and tried to add the following code to make use of FontAwesome:
      a.c2a:before {
          content: "\f07a\00a0";
          font-family: "Font Awesome 5 Pro";
          Font-weight: 900;
          font-style: normal;
          font-weight: normal;
          text-decoration: inherit;
          padding-left: 4px;
      }
       
      The issue is that as soon as I have the CSS via the Custom Styling text box, Pagelines (or the extension) strips out the backslashes (\). As a result, I had to abandon the CSS/LESS extension and instead add all my CSS code to a separate .css file.
      Is there a fix or workaround for this?
      Thanks
      Michael
    • 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.
×