Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By draganFSD on
Hi to all, i have an issue with CSS background problem padding different on every assigned pseudo class for examp
.menu-path-front {height:60px; width:61px; color:#ef9d00; padding-top:15px; padding-left:15px; padding-right:15px; }
.menu-path-front:hover, .menu-path-front a.active { background-image:url(../images/menu-596.png); background-repeat:no-repeat; background-position: 0 0; height:60px; width:61px; color:#FFF; }
so when it hover background image is OK but when link is active then it goes padding once more.
I'm limited to use only this code:
<li class="menu-path-front" id="menu-596"><a class="active" title="" href="/">Home</a></li>
I also spent too many hours searching all over the net to find any similar problem but without success. Hope some1 will help me.
Thanks
Comments
Try this
When you are hovering the background is being applied to the li. When the link is active, the background is being applied to the link. I think you will have to apply the background to the link for all cases.
Try:
If you have problems, you may have to display the link as a block instead of an inline element to get the height / width - this might be done anyway elsewhere. I am not sure if you are trying to remove the padding on hover / active link. If so you will have to specifically set them to 0 for those conditions.
Do you have a link to see the problem and post a description of exactly what you are trying to achieve?
I solve the problem. css
I solve the problem. css could be better but it work.
First i add Nice Menu function, where i add SPAN tag with class.
First one for menuparent and second one for all others:
Then i add this css:
and this is the Nice Menu css
I've only just got your email
I've only just got your email with the link to your site and was going to look at it. It's good that you managed to sort it out yourself.