<bdo id='xkabj'></bdo><ul id='xkabj'></ul>
    <legend id='xkabj'><style id='xkabj'><dir id='xkabj'><q id='xkabj'></q></dir></style></legend>
    <tfoot id='xkabj'></tfoot>
  1. <i id='xkabj'><tr id='xkabj'><dt id='xkabj'><q id='xkabj'><span id='xkabj'><b id='xkabj'><form id='xkabj'><ins id='xkabj'></ins><ul id='xkabj'></ul><sub id='xkabj'></sub></form><legend id='xkabj'></legend><bdo id='xkabj'><pre id='xkabj'><center id='xkabj'></center></pre></bdo></b><th id='xkabj'></th></span></q></dt></tr></i><div id='xkabj'><tfoot id='xkabj'></tfoot><dl id='xkabj'><fieldset id='xkabj'></fieldset></dl></div>

    <small id='xkabj'></small><noframes id='xkabj'>

    1. 悬停过渡 css

      Hover off transition css(悬停过渡 css)

      <tfoot id='rgXuB'></tfoot>

            <tbody id='rgXuB'></tbody>
            <bdo id='rgXuB'></bdo><ul id='rgXuB'></ul>

            <small id='rgXuB'></small><noframes id='rgXuB'>

              <legend id='rgXuB'><style id='rgXuB'><dir id='rgXuB'><q id='rgXuB'></q></dir></style></legend>
              • <i id='rgXuB'><tr id='rgXuB'><dt id='rgXuB'><q id='rgXuB'><span id='rgXuB'><b id='rgXuB'><form id='rgXuB'><ins id='rgXuB'></ins><ul id='rgXuB'></ul><sub id='rgXuB'></sub></form><legend id='rgXuB'></legend><bdo id='rgXuB'><pre id='rgXuB'><center id='rgXuB'></center></pre></bdo></b><th id='rgXuB'></th></span></q></dt></tr></i><div id='rgXuB'><tfoot id='rgXuB'></tfoot><dl id='rgXuB'><fieldset id='rgXuB'></fieldset></dl></div>
                本文介绍了悬停过渡 css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                这个问题可能很明显,但我是 CSS 新手.

                this question might be obvious but i'm new in css.

                我正在为一个形状设置动画,因此当您将其悬停时,它会拉伸.我已经通过一个很好的轻松过渡完成了悬停,但是当你离开鼠标时,过渡不起作用.有没有办法让它在悬停时刻也发生?

                I'm animating a shape so when you hover it, it stretches. I've completed the hover on with a nice ease transition but when you move off the mouse the transition doesn't work. Is there a way to make it happen also in the hover off moment?

                .shape1{
                position: absolute;
                background:red
                top:512px;
                width:180px;
                height:140px;
                }
                
                .shape1:hover {
                height: 160px;
                top:492px;
                transition: 0.2s ease;
                }
                

                推荐答案

                你的答案

                您已在元素的悬停状态上添加了 transition 属性.因此,当您从元素中离开 cursor 时,不会应用 transition.

                Your answer

                You have added the transition property on the hover state of the element. Therefore the transition is not applied when you leave the cursor from the element.

                .shape1{
                    position: absolute;
                    background: red;
                    top: 512px;
                    width: 180px;
                    height: 140px;
                    transition: .2s ease; /* move this here from :hover */
                }
                

                更多信息

                除此之外,您还可以向 transition 添加特定属性.例如,如果您只想对高度进行动画处理,您可以这样:

                Further information

                Besides this you can also add specific properties to the transition. For example, if you only want the height to be animated you could it like this:

                .shape1{
                    transition: height .2s ease;
                    /* this inly affects height, nothing else */
                }
                

                您甚至可以为每个属性定义不同的转换时间:

                You can even define different transition-times for each property:

                .shape1{
                    transition: height .2s ease, background-color .5s linear;
                    /* stacking transitions is easy */
                }
                

                这篇关于悬停过渡 css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Move link image 5px up on hover(悬停时将链接图像向上移动 5px)
                How do I inspect CSS pseudo classes with firebug?(如何使用 firebug 检查 CSS 伪类?)
                Why doesn#39;t CSS hover work on table rows when the cells inside the rows have class names?(当行内的单元格具有类名时,为什么 CSS 悬停在表格行上不起作用?)
                Hover image - display div over it(悬停图像 - 在其上显示 div)
                How to apply a CSS class on hover to dynamically generated submit buttons?(如何在悬停时将 CSS 类应用于动态生成的提交按钮?)
                Differences between CSS3 :hover and :focus?(CSS3 :hover 和 :focus 的区别?)
              • <small id='7EPjG'></small><noframes id='7EPjG'>

                1. <legend id='7EPjG'><style id='7EPjG'><dir id='7EPjG'><q id='7EPjG'></q></dir></style></legend>

                    <i id='7EPjG'><tr id='7EPjG'><dt id='7EPjG'><q id='7EPjG'><span id='7EPjG'><b id='7EPjG'><form id='7EPjG'><ins id='7EPjG'></ins><ul id='7EPjG'></ul><sub id='7EPjG'></sub></form><legend id='7EPjG'></legend><bdo id='7EPjG'><pre id='7EPjG'><center id='7EPjG'></center></pre></bdo></b><th id='7EPjG'></th></span></q></dt></tr></i><div id='7EPjG'><tfoot id='7EPjG'></tfoot><dl id='7EPjG'><fieldset id='7EPjG'></fieldset></dl></div>

                      • <bdo id='7EPjG'></bdo><ul id='7EPjG'></ul>
                            <tbody id='7EPjG'></tbody>
                          <tfoot id='7EPjG'></tfoot>