views:

154

answers:

2

I hope i described the problem well!? You can see it here:

http://dealmob.de/index_dev.html

when u hover over the menu up and down fast u see the that its not staying, insteads its flickering like you would change the margins/paddings by few pixels.

Any advice on how to solve this problem?

thanks a lot

like requested:

        #topcities {
            float:right;
        }  

        #topcities li {
            padding-left:5px;
            width:100px;
        }
        #topcities li:hover {
            cursor:pointer;
            color:#000;
            background: url(images/hover_menue_back.jpg) repeat-x #FFF;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border:grey 1px solid;
            width:100px;
        }
+3  A: 

It because you add a border on hover, and there is no border on non-hover. Add a transparent border to it to prevent it from bouncing.

    #topcities li {
        padding-left:5px;
        width:100px;
        border: 1px solid transparent;
    }

If you don't want a colored border on browsers that don't support border-color: transparent (I'm looking at you IE) you can just add an additional pixel to margin or padding.

Malfist
Some browsers don't support a transparent `border-color`, and will render it (if I remember correctly) as the text `color`.
eyelidlessness
You can also manually adjust the padding to eat up the extra space.
MrHen
@MrHen, my answer has said that for the past 30+ minutes.
Malfist
Hm. Strange, I completely missed it. Sorry. :P
MrHen
A: 

There is a padding-left for non hover, and no padding-left during hover. Add a padding-left rule for your hover rule as well.

Kasturi
this isn't it, and it would be inherited on the hover anyway.
Malfist