gpt4 book ai didi

HTML5 视频移动问题上的 CSS 文本

转载 作者:行者123 更新时间:2023-11-28 01:10:34 24 4
gpt4 key购买 nike

我正在通过 Html5 视频处理此文本和按钮,并且我尝试不使用任何媒体查询来解决我遇到的移动问题。问题是我正在使用 bootstrap 4 的 car-image-overlay 类在视频上显示包含文本的 div。使用其他 bootstraps 4 类将居中左对齐和全部对齐。但是在移动设备(例如:iphone 5e)中,一切都坏了,按钮、h1 和 p 似乎无法调整,所以它覆盖了整个视频,像这张照片一样出帧。我以为 bootstrap 会解决这个问题,但也许我没有以正确的方式做这件事。我也在用col-lg和xs,还是没用

enter image description here

.cta-video-section .cta-video-container {
position: relative;
}
.cta-video-section .cta-video-container video {
height: auto;
vertical-align: middle;
width: 100%;
}
.cta-video-section .cta-video-container h2 {
color: white;
}
.cta-video-section .cta-video-container p {
color: white;
font-family: "Open Sans", sans-serif;
font-size: 1.1rem;
}
.cta-video-section .cta-video-container button {
white-space: normal;
}
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>

<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>



<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous">


</head>

<body>

<div class="container">
<div class="cta-video-section">
<div class="cta-video-container">
<video id="cta-video" autoplay loop muted>
<source src="http://www.icutpeople.com/wp-content/themes/icutpeople/assets/video/waynesworld.mp4" type="video/mp4"> Your
browser does not support the video tag.
</video>
<div class="card-img-overlay d-flex align-items-center" id="cta-video-texts">
<div class="row">
<div class="text-left col-xs-1 col-lg-4 ">
<h2 class="card-title ">H2 Locations Headline</h2>
<p class="card-text ">This is a wider card with supporting text below as a natural lead-in to additional
content. This content is a little bit longer.</p>
<div class="">
<button class="btn btn-danger btn-lg " id="cta-video-button">
Watch Video CTA
</button>

</div>
</div>
</div>
</div>
</div>
</div>



</div>

</body>

</html>

最佳答案

你为什么不想使用媒体查询?

我认为你可以解决这个问题,如果你在移动版本上更改标题、段落和按钮文本和大小。

关于HTML5 视频移动问题上的 CSS 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52124605/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com