- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在实现视频背景时遇到了两个问题:
1) 调整大小时,我的视频背景不会占据屏幕的整个高度。修复它的最佳方法是什么。
2) 我无法点击“返回网站”按钮。
我该如何解决?
HTML
<div>
<div id="outer">
<div id="home-top-video">
<video autoplay loop muted width="100%">
<source src="http://view.vzaar.com/2710053.mp4" type="video/mp4" /> Your browser does not support the video tag. We suggest you upgrade your browser.
</video>
<div id="top-text">
<h3 class="wow fadeIn" data-wow-delay="1s" data-wow-duration="2s" style="font-size: 5em">
Lifestyle
</h3>
<div class="gold-line wow fadeIn" data-wow-delay="1.25s" data-wow-duration="2s" style="margin-top: 25px; margin-bottom: 25px;"></div>
<h5 class="wow fadeIn" data-wow-delay="1.5s" data-wow-duration="2s" style="font-family: 'Josefin Slab', sans-serif; letter-spacing: 4px;">COMING SOON</h5>
</div>
<div id="bottom-text">
<div class="row" style="margin-bottom: 2em; font-family: 'Josefin Slab'">
<div class="col-md-4 wow fadeIn" data-wow-delay="2s" data-wow-duration="2s">"The way of the world is meeting people through other people."</div>
<div class="col-md-4 wow fadeIn" data-wow-delay="2.5s" data-wow-duration="2s">"The way we think, we become"</div>
<div class="col-md-4 wow fadeIn" data-wow-delay="3s" data-wow-duration="2s">"Personal development is a journey, not a destination. Enjoy it, nonetheless."</div>
</div>
<div style="width: 100%;">
<a class="contact-button" href="/about" target="_self" style="z-index: 2">RETURN TO WEBSITE</a>
</div>
</div>
</div>
</div>
</div>
CSS
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
#outer {
width: 100%;
display: block;
text-align: center;
position: relative;
overflow: hidden;
min-height: 100vh;
}
#outer #home-top-video:before {
content: "";
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
z-index: 1;
background: linear-gradient(to right, rgba(71, 75, 84, 0.7), rgba(71, 75, 84, 0.9));
}
#home-top-video {
left: 0%;
top: 0%;
height: 100vh;
width: 100%;
max-width: 1000%;
overflow: hidden;
position: absolute;
z-index: -1;
}
#top-text {
position: absolute;
left: 50%;
top: 8em;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #fff;
z-index: 1;
font-family: 'Early Bird', sans-serif;
width: 300px;
}
#bottom-text {
position: absolute;
left: 50%;
bottom: -12px;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #fff;
z-index: 1;
width: 100%;
}
最佳答案
要使视频适应整个屏幕,包括调整大小的屏幕,您可以将以下样式添加到视频元素本身:
<video id="video" autoplay loop muted width="100%">
#video{
height: 100%;
width: 100%;
object-fit: cover;
}
您的链接不可点击,因为它嵌套在 home-top-video 元素内,其 z-index 设置为 -1。当您简单地删除它时,您的页面样式不会改变。
#home-top-video {
left: 0%;
top: 0%;
height: 100vh;
width: 100%;
max-width: 1000%;
overflow: hidden;
position: absolute; // delete this
z-index: -1; // and delete this
}
虽然这解决了这两个问题,但另一个问题是当您垂直调整屏幕大小时,底部文本会与顶部文本混淆。你可以用 css grid 或 flex 来解决这个问题。但是有太多的 div 和内联样式,我不知道从哪里开始。除了上面提到的两行之外,还有更多的 css 你可以删除而不会注意到样式有任何变化顺便说一句。
我希望这对你有进一步的帮助。
关于html - 视频背景未调整到窗口的全高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48963075/
我想做一个模板 页眉+侧边栏(半页/全高)+谷歌地图(半页/全高) 在 jsfiddle 中,很难看到细节,但在浏览器的一侧给我一个我不想要的滚动条。此外,侧边栏比预期高 40 像素(标题的高度)。而
我有一张背景图片,我想在我的网站上使用它,但问题是我无法将其制作成任何尺寸的全高和全宽,请帮助我,请检查下面的代码 当前代码,代码 #1:haft 而不是 full body { backgr
我想在网站中放置一个图像作为背景,我希望该图像具有响应性,但页脚始终位于底部,以便图像调整大小此外,我希望在宽度上被“切断”。我举三个例子。 示例 # 1:以 16:9 浏览网页 http://i.s
我需要将 2 个子容器“左”和“右”设为 100% 高度,因为父容器“”已经存在 - 这怎么可能?我如何管理一个适当的水平放置的容器“hexCont”? CSS: html, body {
我已经开始学习 angular 2 Material ,这很令人困惑,因为我在文档和官方中找不到很多东西 material.io css 是根据类编写的,而 Angular Material 使用“类
我继承了一个 iOS 应用程序,但我发现没有使用全高。这是 iPhone 6 上的照片: 它似乎卡在了 iPhone 4 的分辨率上。 iOS 部署目标:7.1 有什么想法可以让整个应用的高度适合全屏
我有以下 HTML 来构建一个 900 像素宽的居中页面,其中包含页眉、页脚和内容部分:
我创建了一个简单的网站,每隔几秒钟就会更改一次图像。所有图像均为横向。当我的浏览器处于正常 View 模式时,图像覆盖浏览器的整个高度,但是当我将浏览器更改为全屏模式时,图像并没有覆盖浏览器的整个高度
我使用以下代码来显示全高的 div(具有背景颜色)。 HTML here is a lot of text....
在我的网页设计中获取父 div 的完整高度时遇到了一些麻烦。容器div是一个div内的div,高度为100%。 我已经尝试阅读关于 stackoverflow 和其他人的一些其
我试图使用此 CSS 使标题填满屏幕: position:relative; margin:0; padding:0; width:100%; height:100%; min-height:100%
我目前正在尝试实现以下场景: 我正在使用以下 HTML 和 CSS 代码。 ( See JSFiddle for example ) HTML:
我知道类似的问题已经被问过很多次,但我尝试了很多答案,但似乎没有一个适合我的情况。我找到了很多针对粘性页脚的解决方案,但这并不是我想要的,或者我还没有想出如何根据我的情况正确使用: 我有完全固定的位置
我正在通过 Bootstrap 制作左侧,并且在设置我的内部元素固定位置时遇到这个问题。 这是我的HTML
我对简单的 html/css 技巧有疑问。 我想创建左栏高度为 100% 的网站,例如宽度 300px,在右侧我想要 contener div 和其余的宽度。 下面的代码: html {min-hei
我正在开发一个当前配置为全高(即 100% 可用浏览器窗口)应用程序的新网站。在布局方面,它是这样的 - http://stevesanderson.github.com/fixed-height-l
让 div 始终保持 100% 高度的诀窍是什么,即使用户正在滚动也是如此? 我试过了,但没有成功,因为高度只应用于事件窗口。 [...] ... .popup_contai
正如标题所说。我想插入一个延伸到窗口末尾的 FB 页面提要。这可能吗?当我在 iframe 上设置它时,我认为 800px 是它想要达到的最高值。我到处寻找答案,但没有成功。 我用过 Facebook
我正在制作一个具有固定导航栏、全屏背景和中间文本的页面。而且我不知道如何让它在横向模式下响应。在其他版本上,它表现正常,但在横向上,因为我认为高度要小得多,所以文本与导航栏重叠。而且看起来真的很乱。
我想做的是: 创建一个全高 div,滚动后转到固定的顶部 div。 1) ----------- | | | | | | |--
我是一名优秀的程序员,十分优秀!