h5全屏视频背景_创建全屏HTML5页面背景视频

h5全屏视频背景

While we can’t yet set a video for the background or background-image properties – they can only take bitmaps, images, colors and gradients as values – it is possible to fake the appearance of a background video by forcing it behind other HTML elements. The challenge is to have the video fill the browser window, making it as responsive as background images.

虽然我们还不能设置为视频backgroundbackground-image 属性-他们只能采取位图图像, 色彩渐变的价值-这可能的假背景视频的出现,迫使它背后的其他HTML元素。 挑战在于使视频充满浏览器窗口,使其与背景图像一样敏感。

注意事项和局限性 (Considerations and Limitations)

Before achieving this, there some factors you should consider:

在实现此目标之前,应考虑一些因素:

  • Don’t just use this technique because you can: video content must amplify a site’s message, not just be shown because it’s pretty.

    不要仅仅使用这种技术,因为您可以: 视频内容必须放大网站的信息 ,而不仅仅是因为它的美观而被展示。

  • The video will likely be set to autoplay, but it should be muted by default; ideally, it should not include sound at all. (You can easily create an unmute button for the video with JavaScript).

    视频可能会设置为autoplay ,但默认情况下应将其静音; 理想情况下,它根本不应该包含声音 。 (您可以使用JavaScript轻松为视频创建一个取消静音按钮)。

  • The video should display a placeholder image, falling back to a static background image for browsers that do not support HTML5. The placeholder image will also be used a background on mobile devices: many phones and tablets do not support autoplay, for obvious reasons.

    对于不支持HTML5的浏览器,视频应显示一个占位符图像,并回退到静态背景图像。 占位符图像还将在移动设备上用作背景:出于显而易见的原因,许多手机和平板电脑都不支持autoplay

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值