引导程序最大高度不起作用

时间:2018-06-29 16:16:11

标签: css bootstrap-4

伙计们,所以我有一个引导站点,我建立了一个相当基本的头文件,如下所示:

<form class="ui form" id="formOne">
  <div class="field" id="radio" >
    <div class="ui radio checkbox">
      <input type="radio" value="one" name="number">
      <label>One</label>
    </div>
    <div class="ui radio checkbox">
      <input type="radio" value="two" name="number">
      <label>Two</label>
    </div>
  </div>
  <button class="ui button" type="submit">Submit</button>
</form>


$(document).ready(function(){
  $('.ui.radio.checkbox').checkbox();

$('#formOne').submit(e => {
       let num = $('[name="number"]:checked').val();
       console.log(num);
       e.preventDefault();
  });
});

我将此头文件包含在index.php文档中,并试图制作一个视频,该视频跨越浏览器宽度的100%,最大高度为800px,但无论我做什么视频都无法正常工作两侧的空白区域不跨越所有宽度。这里的任何帮助将是巨大的!我基本上希望视频始终居中且响应迅速。类似于img响应类。这是索引文件的副本

<head>
    <style>
        nav a{
            color: white
        }
        nav {background-color: #1c71b9; }
        .navbar-toggle{border: 3px solid white;}
        .icon-bar{background-color: white;}
        .navbar-brand:hover{background-color: white;
        color: #1c71b9;
        }
        body{margin-top: 50px;}
        h1, h2, h3, h4, h5, h6, p{
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
        }
        .row + .row{margin-top: 20px;}
    </style>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link href="https://fonts.googleapis.com/css?family=Raleway:400,700,800" rel="stylesheet">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <script src="vue.js"></script>
</head>

<header>
 <nav class="navbar navbar-fixed-top">
    <div class="container">
     <div class="navbar-header">
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
         <span class="sr-only">Toggle Navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
         </button>
         <a class="navbar-brand" href="index.php">My Site</a>
        </div><!--end .navbar-header-->
        <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Subscriptions</a></li>
            <li><a href="#">Templates</a></li>
            <li><a href="#">Stock</a></li>
            <li><a href="#" data-toggle="modal" data-target="#loginModal">Login</a></li>
            <li><a href="#">Signup</a></li>
            </ul>
        </div><!--end #navbar-->
     </div><!--end container-->
    </nav>
     <div class="container">
      <div id="loginModal" class="modal fade" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
            <!--modal header-->
                <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">X</button>
                <h2 class="modal-title">Login</h2>
                </div>
                <!--modal body-->
                <div class="modal-body">
                <form role="form">
                    <div class="form-group">
                        <label for="username">Username/Email</label>
                        <input type="text" class="form-control" placeholder="Username/Email" id="username" name="username">
                        <a href="#">Forgot Username</a>
                    </div>
                    <div class="form-group">
                        <label for="password">Password</label>
                    <input type="password" class="form-control" placeholder="Password" name="password" id="password">
                        <a href="#">Forgot Password</a>
                    </div>
                    </form>
                </div>
                <!--modal footer-->
                <div class="modal-footer">
                <button class="btn btn-primary btn-block">Login</button>
                </div>
            </div>
            </div>
        </div>
     </div>
    </header>

2 个答案:

答案 0 :(得分:0)

如果在容器流体中使用引导包装视频。这横跨了视口(view documentation)的整个宽度。您可以尝试这样的事情:

 <div class="container-fluid">
      <video src="Balloon.mp4" autoplay="true" loop="true"></video>
 </div>

然后在您的CSS中:

 div video {
     height: 800 px;
 }

答案 1 :(得分:0)

如果您希望视频覆盖div的整个宽度,请不要设置视频的高度,视频将始终保持其纵横比,因此,如果您设置高度,宽度也会相应地减小。因此最好的方法是为包裹视频的div设置高度,让视频扩展100%