Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 赢得图像';t翻转_Html_Css - Fatal编程技术网

Html 赢得图像';t翻转

Html 赢得图像';t翻转,html,css,Html,Css,尝试创建类似的效果,如下所示: 然而,我被我的代码卡住了,它不会完全翻转 以下是我的CSS: /* Paragraphs and Heading 2 styling, change according to your needs */ .slide p, .slide h2 { color:#ffffff; padding:10px; left: -20px; top: 20px; position: relative; } .slide p {

尝试创建类似的效果,如下所示:

然而,我被我的代码卡住了,它不会完全翻转

以下是我的CSS:

/* Paragraphs and Heading 2 styling, change according to your needs */
 .slide p, .slide h2 {
    color:#ffffff;
    padding:10px;
    left: -20px;
    top: 20px;
    position: relative;
}
.slide p {
    font-family:'Lato';
    font-size:12px;
    line-height:18px;
    margin: 0;
}
.slide h2 {
    font-size:20px;
    line-height:24px;
    margin: 0;
    font-family:'Lato';
}
/* 1. Sliding Up */
 .moveup img {
    position: absolute;
    left: 0;
    top: -15px;
    width: 100%;
    /*Fit the image to its container. the aspect ratio is preserved; the image will not be distorted*/
    cursor: pointer;
    -webkit-transition: transform 2s ease-in-out;
    -moz-transition: top .5s ease-in-out;
    -o-transition: top 2s ease-in-out;
    transition: transform .5s ease-in-out;
}
.slide:hover img{
    -webkit-transform:rotateY(90deg);
    backface-visibility:hidden;
    /*set to a value to hide the whole image*/
    padding-bottom:200px;
}

.slide:hover .a{
    -webkit-transform:rotateY(360deg);

    /*set to a value to hide the whole image*/
    padding-bottom:200px;
}

.a{
    transition:.5s ease-in;
}
知道我弄错了哪一部分吗

以下是JSFIDLE:


提前谢谢你的帮助

如果要使用该示例,为什么不使用它们的结构?我要说的是,这个教程似乎遗漏了很多使这个东西工作的风格。我希望我能更好地解释你做错了什么,但我在底部添加了一个工作小提琴,代码如下:

HTML

<figure>
   <img src="http://beautyblenderdupe.com/wp-content/uploads/2015/01/01.jpg" alt=""/>
   <figcaption>
       <h2>This is a cool title!</h2>
       <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nost.</span>
   </figcaption>
</figure>

我的意图是帮助……他们或某人情绪不好……不要给我时间来调整我的答案……只是给出负面的观点。保持冷静,这里有工作。我对
转换做了一些更改,但没有添加答案,因为技术与我的完全相同。如果你觉得很难破译,我会补充一个完整的解释的变化。有一些问题,在原来的代码配合。(1) 旋转角度90和360是错误的(2)背面最初没有隐藏(通过旋转180度或-180度)是的,还有一些问题,结构上是错误的,是的,角度是错误的,还有其他一些问题。
.slide figure {
    margin: 0;
    position: relative; 
}

.slide figure img {
    display: block;
    position: relative;
    z-index: 10;
    max-width: 100%;
    height: auto; 
}

.slide figure figcaption {
    display: block;
    position: absolute;
    z-index: 5; 
    padding: 20px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.slide figure h2 {
    font-family:'Lato';
    color: #fff;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 10px; 
}

.slide figure span {
    display: block;
    font-family:'Lato';
    font-size:12px;
    line-height:18px;
    margin: 0;
    color: #FFF;
}


.slide figure figcaption {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 76, 110, 0.5);
    text-align: center;
    backface-visibility: hidden;
    transform: rotateY(-180deg);
    transition: all 0.5s;
}
.slide figure figcaption h3 {
    margin-top: 150px
}
.slide figure img {
    backface-visibility: hidden;
    transition: all 0.5s;
}
.slide figure:hover img,
#effect-2 figure.hover img {
    transform: rotateY(180deg);
}
.slide figure:hover figcaption,
#effect-2 figure.hover figcaption {
    transform: rotateY(0);
}`enter code here`