CSS3 transition for “top” and “left” properties not working

℡╲_俬逩灬. 提交于 2019-11-30 23:02:54

问题


I have a list with one item on the list transitioning to the northeast when I hover over it. Using margin-top and margin-left property transitions worked but the item being hovered over kept pushing other elements so I added position:relative and tried using top and left transition properties but it didn't seem to be working.

Here is the jsfiddle:

list hover


回答1:


Have you tried setting the parent of your list. I know sometimes relative has issue unless the underlying item is also relative or absolute. Just a thought.




回答2:


Add left, top default link demo

left: 0px



回答3:


Use position:absolute and it will take it out of the normal document flow. You could also give it z-index:5 to make sure it floats over other elements.



来源:https://stackoverflow.com/questions/8109109/css3-transition-for-top-and-left-properties-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!