html - 如何在预设图像中嵌入图像或视频

标签 html css image video styles

我正在写一个网站介绍页面,非常喜欢这个页面的风格:http://www.davidhutton.com/在另一张图片中有移动的图片/视频。

为简化起见,我如何将图像放入此处的电视容器中:http://jsfiddle.net/h9Nn3/2/

我不确定它有多复杂,但它过于复杂,至少一个起点将不胜感激!

最佳答案

根据你的例子,你可以这样解决:

<style>
div.container {
    width:          337px;
    height:         297px;
    padding:        25px 35px 0px 28px;
    background:     url(http://www.officialpsds.com/images/thumbs/tv-screen-1-psd29071.png) no-repeat 0 0;
}

div.container > div {
    height:         189px;
    overflow:       hidden;
    border:         1px solid red;
}
</style>

<div class="container">
    <div>
        This container should have a red border and fit's exactly the screen.
        You can replace or fill it with everything you want, for example an img-tag.
    </div>
</div>

关于html - 如何在预设图像中嵌入图像或视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11109847/

相关文章:

jquery - 带掩码覆盖的轻量级 JQuery slider

jquery - 在div中显示html文件

html - 对齐两个内容会导致内容立即缩小

html - 嵌套列表项样式(带有空容器列表项)

c# - 不支持图像的给定路径格式

asp.net - HTML img 和 ASP.NET 图像和相对路径

javascript - 在 css 菜单栏中突出显示当前选定的链接

html - 为什么 anchor 按钮超出包装边界?

css - <div> 元素上的位置不正确

python - 让文本显示在子图图像前面