用css替换带有youtube视频的图像

时间:2014-11-08 21:33:46

标签: html css image replace youtube

我正在使用模板网站。我想用youtube视频替换现有的图像。我知道如何从youtube获取代码以匹配图像尺寸,但我不知道在模板中要更改什么。

这是来自css ...

的代码
.section-1 { background: url(../img/left-box-1.jpg) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height: 600px; position: relative; }

和html中的相应部分......

<div class="col-md-8 section-1 nopadding" id="work">
                <div class="logo-1 wp1"></div>
            </div>

1 个答案:

答案 0 :(得分:1)

<html>
<head>
  <title></title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<style>
.section-1 { background: url(../img/left-box-1.jpg) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height: 600px; position: relative; }
</style>
</head>
<body>
<div class="col-md-8 section-1 nopadding" id="work">
    <div class="logo-1 wp1">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/8dKLp2KB8u4" frameborder="0" allowfullscreen>
        </iframe>
    </div>
</div>
<script>

</script>
</body>
</html>