CSS3过渡为“顶部"和“左"属性不起作用 [英] CSS3 transition for "top" and "left" properties not working

查看:108
本文介绍了CSS3过渡为“顶部"和“左"属性不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表,当我将鼠标悬停在列表上时,列表上的一项过渡到东北.使用margin-topmargin-left属性转换可以工作,但是将鼠标悬停在该项目上会继续推动其他元素,因此我添加了position:relative并尝试使用topleft过渡属性,但是它似乎没有用. /p>

这是jsfiddle:

列表悬停

解决方案

您是否尝试过设置列表的父级.我知道有时亲戚会有问题,除非基础项目也是亲戚或绝对的.只是一个想法.

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

解决方案

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.

这篇关于CSS3过渡为“顶部"和“左"属性不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆