【发布时间】:2017-04-02 19:29:39
【问题描述】:
我有以下图片:
现在我想用响应式视图在这张图片上放置一个 vimeo 视频:
为此,我使用以下 css 和 html 代码:
html代码:
<div class="vimeo">
<article>
<figure>
<iframe src="https://player.vimeo.com/video/211148482?autoplay=1&title=0&byline=0&portrait=0" width="568" height="453" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</figure>
</article>
</div>
CSS 代码:
.vimeo {
font: 16px/1.4 Georgia, Serif;
width: 45%;
margin: 1px auto;
background: url(images/bg.jpg);
background-size: contain;
background-repeat: no-repeat;
position: relative;
}
pre, article style, article script {
white-space: pre;
display: block;
overflow-x: auto;
}
img {
max-width: 100%;
}
figure {
display: block;
}
figcaption {
display: block; text-align: center; orphans: 2;
}
现在看起来像这样:
我想在图像灰色背景上设置它,我该怎么做?
【问题讨论】: