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

      • <bdo id='Szs1G'></bdo><ul id='Szs1G'></ul>

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

      1. 使用 css3 进行图像替换和过渡?

        Image substitution and transition with css3?(使用 css3 进行图像替换和过渡?)

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

                <bdo id='qzJIZ'></bdo><ul id='qzJIZ'></ul>

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

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

                  本文介绍了使用 css3 进行图像替换和过渡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想知道是否有人知道如何在两个背景图像之间进行转换的聪明而新的方法?我知道那里有很多教程,只是其中大部分都过时了.

                  I wonder If anybody knows a clever and new way how to make a transition between two background images? I know there are multiple tutorials out there just most of them are outdated and old.

                  我想知道是否有一种聪明而现代的 CSS3 方式来做这样的事情.

                  I wonder if there is a clever and modern CSS3 way of doing something like this.

                  我有一个简单的 logo.png 设置为 div.logo 的背景(我希望它不是通过 img src 设置为背景图像).当我将鼠标悬停在它上面时,我希望平滑过渡到logo-hover.png",这是同一个文件,只是颜色不同.

                  I have a simple logo.png set as background to a div.logo (I want it to be set as a background image not via img src). And when I hover over it I want a smooth transition to "logo-hover.png" which is the same file just in a different color.

                  现在有什么想法吗?

                  我的方法是这样的:- 我在 div.logo 周围创建了一个相对位置的外部容器.我在其中放置两个 div,绝对位置彼此重叠.div.hover 设置为 display:none,如果我将其悬停,我会使用 css3 过渡为其不透明度设置动画.

                  My approach would be this: - I create a outer container around div.logo wich position relative. I position two divs inside of it with position absolute on top of each other. The div.hover is set to display:none and if I hover it I use css3 transition to animate it's opacity.

                  这是唯一的方法吗?我实际上很喜欢使用纯 css 方式,我不必向 dom 本身添加具有悬停状态的额外 div.

                  Is this the only way of doing this? I'd actually love to use a pure css way where I don't have to add an additional div with the hover state to the dom itself.

                  关于这件事有什么想法吗?

                  Any ideas on that matter?

                  提前谢谢你.

                  推荐答案

                  使用这个

                  #home .stripes, #home .stripes:hover a {
                      text-indent: -9999px;
                      width: 116px;
                      height: 128px;
                      margin: 50px 0px 0px 56px;
                      float:left;
                      padding: 0;
                      background:url('http://www.clipartpal.com/_thumbs/024/christmas/christmas_024_02_tns.png');
                  }
                  #home .stripes a {
                      background:url('https://secure.10foldsolutions.com/ecommerce/images/9/products/29197.jpg');
                      -webkit-transition: all .6s ease-in-out;
                      -moz-transition: all .6s ease-in-out;
                      -o-transition: all .6s ease-in-out;
                      -ms-transition: all .6s ease-in-out;
                      transition: all .6s ease-in-out;
                  }
                  #home .stripes a:hover, #home .stripes a:focus {
                      background:url('https://secure.10foldsolutions.com/ecommerce/images/9/products/29197.jpg');
                      opacity: 0;
                  }
                  

                  这篇关于使用 css3 进行图像替换和过渡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的区别?)
                • <legend id='8CW5K'><style id='8CW5K'><dir id='8CW5K'><q id='8CW5K'></q></dir></style></legend>
                • <i id='8CW5K'><tr id='8CW5K'><dt id='8CW5K'><q id='8CW5K'><span id='8CW5K'><b id='8CW5K'><form id='8CW5K'><ins id='8CW5K'></ins><ul id='8CW5K'></ul><sub id='8CW5K'></sub></form><legend id='8CW5K'></legend><bdo id='8CW5K'><pre id='8CW5K'><center id='8CW5K'></center></pre></bdo></b><th id='8CW5K'></th></span></q></dt></tr></i><div id='8CW5K'><tfoot id='8CW5K'></tfoot><dl id='8CW5K'><fieldset id='8CW5K'></fieldset></dl></div>

                        • <bdo id='8CW5K'></bdo><ul id='8CW5K'></ul>
                          <tfoot id='8CW5K'></tfoot>

                          <small id='8CW5K'></small><noframes id='8CW5K'>

                              <tbody id='8CW5K'></tbody>