Welcome to the Treehouse Community
Looking to learn something new?
Css box-shadow problem!
Hello, ive tried to make a 3d looking button, but know when i hover over the button, and moves down. all the divs under it, moves along with it. is there any fix for this?
Heres a fiddle so you can see the problem!
Ryan FieldCourses Plus Student 21,240 Points
What's happening is that you are animating the border by reducing it's width, which will affect any elements around it, especially since it's positioned relatively.
To fix this, you can instead animate the
box-shadow property, which won't affect elements around it because it's not technically taking up space as part of the element.
Here's a modified version of your fiddle showing you how it won't move.