June 23, 201313 yr Hi , someone knows how to overcome extending padding on :hover border ? I want the first button stop affecting the other one on mouseover . exemple here http://jsfiddle.net/fbsaD/ Thanks /sorry wrong category , please move/ Edited June 23, 201313 yr by NiBi18
June 23, 201313 yr Hi Maybe you can try and give your li a transparent border: li{border:15px solid transparent;} then keep the black border on hover, so the brder is there at the first place, but not visible and becomes visible (black) on hover. Hope that makes sense
June 23, 201313 yr you could change the margin size on hover so that it stll rounds up to to the 20px either side #nav li:hover {border:15px solid black;margin:0 5px 5px 5px}
June 23, 201313 yr Best solution I've found is to add a negative margin, or reduce it in pixels by the amount of your border. So as per your example, add this to the :hover state. margin: -15px 5px -10px 5px;
June 23, 201313 yr Or you could just position them absolutely in a relative container: http://jsfiddle.net/fbsaD/
Create an account or sign in to comment