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

    2. <small id='GZVKK'></small><noframes id='GZVKK'>

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

      想要在旋转时显示元素的厚度

      时间:2023-10-13

            <bdo id='4UMyg'></bdo><ul id='4UMyg'></ul>
              <tbody id='4UMyg'></tbody>

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

              <small id='4UMyg'></small><noframes id='4UMyg'>

                本文介绍了想要在旋转时显示元素的厚度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我通过 CSS 将一枚硬币沿 Y 轴旋转 90 度.有没有办法让我可以在硬币旋转后显示硬币的厚度,我想我可以在硬币沿 Y 轴旋转后缩放 Y,但这似乎不起作用.如果可能的话,请提出一些方法来做同样的事情.link_on_js fiddle 同样.请使用 webkit 浏览器打开链接.

                I am rotating a coin along Y axis by 90deg through CSS. Is there a way so that I can show the thickness of the coin after it have rotated, I thought I can scaleY after the coin have rotated along Y axis but this doesn't seem to work. Please suggest some way to do the same if it is possible. link_on_js fiddle for the same. Please use webkit browsers to open the link.

                css

                .coin {
                    display: block;
                    background: url("url-to-image-of-coin.jpg");
                    background-size: 100% 100%;
                    width: 100px;
                    height: 100px;
                    margin: auto;
                    border-radius: 100%;
                    transition: all 500ms linear;
                }
                
                .flip {
                    transform: rotateY(180deg);
                }
                

                html

                <div class="coin"></div>
                

                jquery

                $('.coin').click(function() {
                    $(this).toggleClass('flip');
                });
                

                小提琴

                http://jsfiddle.net/7EtLu/22/

                推荐答案

                您可以使用伪元素来提供类似的效果.这是一个示例:http://jsfiddle.net/joshnh/y7rQL/

                You can use pseudo-elements to give an effect that is similar. Here is an example: http://jsfiddle.net/joshnh/y7rQL/

                <div class="coin"></div>

                body {
                    transform: perspective(500px);
                    transform-style: preserve-3d;
                }
                .coin {
                    background-image: url("http://www.coolemails4u.com/wp-content/uploads/2010/10/indian_rupee.png");
                    background-size: 100% 100%;
                    border-radius: 100%;
                    height: 100px;
                    margin: 50px auto;
                    position: relative;
                    transition: .5s linear;
                    transform-style: preserve-3d;
                    width: 100px;
                }
                .coin:after {
                    background-color: #262626;
                    background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
                    bottom: 0;
                    content: '';
                    left: 45px;
                    position: absolute;
                    top: 0;
                    transform: rotateY(-90deg);
                    transform-origin: 100% 50%;
                    width: 5px;
                    z-index: -10;
                }
                .coin:before {
                    background-color: #262626;
                    background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
                    border-radius: 100%;
                    content: '';
                    height: 100px;
                    left: 0;
                    position: absolute;
                    top: 0;
                    transform: translateZ(-5px);
                    width: 100px;
                }
                .coin:hover {
                    transform: rotateY(90deg);
                }​
                

                另外,这里有一个旋转 180 度的版本(虽然不是很好):http://jsfiddle.net/joshnh/Bz22S/

                Also, here is a version that spins 180 degrees (it isn't quite as nice though): http://jsfiddle.net/joshnh/Bz22S/

                这篇关于想要在旋转时显示元素的厚度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何获得用css旋转转换的元素的位置 下一篇:在 jQuery 中转换

                相关文章

                最新文章

                  <bdo id='GBR3v'></bdo><ul id='GBR3v'></ul>
              1. <legend id='GBR3v'><style id='GBR3v'><dir id='GBR3v'><q id='GBR3v'></q></dir></style></legend>

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

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