Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Menu a:hover CSS

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-27-2016, 08:09 AM
 
Doherty Doherty is offline
 

Member
  
Join Date: Feb 2016
Location: UK
Posts: 22
 

Default Menu a:hover CSS

Back again having fun playing with the CSS!

This is what i have so far;
Code:
.banner-carousel .carousel-indicators li { border-color: red; } .banner-carousel .carousel-indicators .active { background-color: red; } .navbar-inverse { background-color:red; border-color: red; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: #760303; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #760303; }

Problem with this is that the .navbar seems to have a property that keeps the a:hover grey and I can't seem to change it what so ever!

any thoughts?
__________________
X-Cart Version: 5

License products:
X-Cart Gold
Product Configurator
Feature Comparison
Refine Filters
Reply With Quote
  #2  
Old 04-27-2016, 09:23 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Menu a:hover CSS

Please read about the CSS specificity:
https://www.smashingmagazine.com/2007/07/css-specificity-things-you-should-know/

I believe you can solve this by adding an extra CSS class to the selectors.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 04-28-2016, 12:22 AM
 
Doherty Doherty is offline
 

Member
  
Join Date: Feb 2016
Location: UK
Posts: 22
 

Default Re: Menu a:hover CSS

Quote:
a:hover {
background-color: yellow;
}

When I add this code into the .navbar it makes the whole bar itself hover with yellow but the actual menu items remain grey when hovered...

I'm stumped!
__________________
X-Cart Version: 5

License products:
X-Cart Gold
Product Configurator
Feature Comparison
Refine Filters
Reply With Quote
  #4  
Old 04-28-2016, 03:37 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Menu a:hover CSS

No! I mean you should add an extra class to selectors like this:
".navbar-inverse .navbar-nav > li > a:hover"

For example, ".navbar.navbar-inverse .navbar-nav > li > a:hover".
Or "#page .navbar-inverse .navbar-nav > li > a:hover".

This will increase the CSS specificity of these rules and make them override other rules that make menu items gray.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 04-28-2016, 04:12 AM
 
Doherty Doherty is offline
 

Member
  
Join Date: Feb 2016
Location: UK
Posts: 22
 

Default Re: Menu a:hover CSS

Really appreciate the help, I'm obviously not experienced and learning as I go

The line of code you mentioned above;
".navbar-inverse .navbar-nav > li > a:hover"

Is already within the CSS, 12th row.
__________________
X-Cart Version: 5

License products:
X-Cart Gold
Product Configurator
Feature Comparison
Refine Filters
Reply With Quote
  #6  
Old 04-28-2016, 09:36 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Menu a:hover CSS

Yes, it is in the custom CSS. But I believe there is another CSS file having the same selector, and since that file is loaded later, its rules override yours.

So, you should add one more tag, or a css class, to the selector. Like this:
".navbar.navbar-inverse .navbar-nav > li > a:hover".
Or this:
"#page .navbar-inverse .navbar-nav > li > a:hover".

Perhaps you need more extra selectors.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
Doherty (05-04-2016)
  #7  
Old 05-08-2016, 07:49 AM
 
rapidserverz rapidserverz is offline
    
Join Date: May 2016
Posts: 2
 

Default Re: Menu a:hover CSS

i am having the similar issues no matter what code i put in the custom css the top menu has pink links can someone help heres my page for people to look what i mean also how do i get that background image to fill the whole page instead of just half way thanks in advance www.heinz57beans.com/xcart
__________________
5
Reply With Quote
  #8  
Old 05-08-2016, 08:14 AM
 
rapidserverz rapidserverz is offline
    
Join Date: May 2016
Posts: 2
 

Default Re: Menu a:hover CSS

i have the same issue can someone please help me my navbar menu is staying a pink color no matter what code i put in css also have issue with background image only showing half screen please take a look at my page so you can see faults what i mean
__________________
5
Reply With Quote
  #9  
Old 05-10-2016, 08:25 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Menu a:hover CSS

Quote:
Originally Posted by rapidserverz
i have the same issue can someone please help me my navbar menu is staying a pink color no matter what code i put in css also have issue with background image only showing half screen please take a look at my page so you can see faults what i mean
Try:
Code:
#header-area .navbar-inverse.mobile-hidden .navbar-nav > li > a:hover { color: #fff; }
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
qualiteam (05-11-2016)
  #10  
Old 05-11-2016, 02:50 AM
 
Doherty Doherty is offline
 

Member
  
Join Date: Feb 2016
Location: UK
Posts: 22
 

Default Re: Menu a:hover CSS

Hi guys,

I got mine working just fine using qualiteam's code;

Quote:
#page .navbar-inverse .navbar-nav > li > a:hover {
background-color: #ff3300;
}
__________________
X-Cart Version: 5

License products:
X-Cart Gold
Product Configurator
Feature Comparison
Refine Filters
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:58 PM.

   

 
X-Cart forums © 2001-2020