【发布时间】:2015-04-09 16:06:31
【问题描述】:
我在尝试绕过这些包含 Youtube 图像和 iframe 的 div 的角落时遇到了一点问题。
我试图让每个带有视频的单独框即使在淡入之后也显示为圆形。您可以在这里看到:example
每当我添加border-radius:10px;对于 video-container CSS 和 caption-style-4 img CSS,它会圆化每个角,但右上角以及鼠标悬停时会短暂恢复为无圆角,然后再次出现圆角。
这是不带圆角的视频容器的 CSS:
video-container {
width: 310px;
margin: 7px;
height: 310px;
border-radius: 0px;
overflow: hidden;
display: none; float: left;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
text-align: center;
position: relative;
}
.caption-style-4 li:hover .caption{
opacity: 1;
}
.caption-style-4 img{
margin: 0px;
padding: 0px;
border-radius: 10px;
float: left;
z-index: 4;
}
.caption-style-4 img{
margin: 0px;
padding: 0px;
float: left;
z-index: 4;
}
这是其中一个视频容器的 HTML 代码:
<ul class="caption-style-4"><li>
<a href="http://www.youtube-nocookie.com/embed/Ay7Z45XTlIg? iframe=true&width=853&height=480" rel="prettyPhoto[iframes]" >
<img src="http://8-playerpictures.com/wp-content/uploads/2014/04/NCAA-Innovation-Summit.png" alt="NCAA Innovation Summit-Ashley Johnson"/>
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>NCAA Innovation Summit</h1>
<p></p>
</div>
</div>
</li>
</ul>
它不能与 iFrame 一起使用是否有原因?这只是没有在正确的地方添加它的问题吗?
感谢您的所有帮助!
【问题讨论】:
-
看起来您使用的是链接,而不是 iFrame。