Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用引导法进行定心是';不行吗? 试图在页面中间集中一行。但是,代码h-100和my auto在我放置它们的任何div上都不起作用 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> <div class="search-page"></div> <div class="container search-items"> <div class="row h-100 justify-content-center searchBar"> <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8"></div> <div class="input-group"> <input type="text" class="form-control col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9" id="search-input" placeholder="" autocomplete="off" required aria-label="Text input with dropdown button"> <input type="text" class="form-control col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3" id="zip-input" placeholder="" onkeypress="return (event.charCode !=8 && event.charCode ==0 || (event.charCode >= 48 && event.charCode <= 57))" required> <div class="input-group-append dropdown-container"> <button class="btn btn-outline-secondary btn-success dropdown-toggle" id="" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button> <div class="dropdown-menu"> <section id="dropDown"> <select class="mdb-select colorful-select dropdown-primary md-form" id="" multiple searchable="Search here.."> <option value="" disabled selected></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> </select> <div class="form-group row"> <div class="col-5"> <input class="form-control" type="number" id="calorie-input" /> </div> <label for="example-number-input" class="col-2 col-form-label" ></label > <!-- End of Calories input --> </section> <!-- End Multiselect Drop down --> </div> </div> </div> <button type="button" id="searchBtn" class="btn btn-success">blah</button> </div> </div> </div> 下拉列表 废话_Html_Css_Twitter Bootstrap_Bootstrap 4 - Fatal编程技术网

Html 使用引导法进行定心是';不行吗? 试图在页面中间集中一行。但是,代码h-100和my auto在我放置它们的任何div上都不起作用 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> <div class="search-page"></div> <div class="container search-items"> <div class="row h-100 justify-content-center searchBar"> <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8"></div> <div class="input-group"> <input type="text" class="form-control col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9" id="search-input" placeholder="" autocomplete="off" required aria-label="Text input with dropdown button"> <input type="text" class="form-control col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3" id="zip-input" placeholder="" onkeypress="return (event.charCode !=8 && event.charCode ==0 || (event.charCode >= 48 && event.charCode <= 57))" required> <div class="input-group-append dropdown-container"> <button class="btn btn-outline-secondary btn-success dropdown-toggle" id="" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button> <div class="dropdown-menu"> <section id="dropDown"> <select class="mdb-select colorful-select dropdown-primary md-form" id="" multiple searchable="Search here.."> <option value="" disabled selected></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> </select> <div class="form-group row"> <div class="col-5"> <input class="form-control" type="number" id="calorie-input" /> </div> <label for="example-number-input" class="col-2 col-form-label" ></label > <!-- End of Calories input --> </section> <!-- End Multiselect Drop down --> </div> </div> </div> <button type="button" id="searchBtn" class="btn btn-success">blah</button> </div> </div> </div> 下拉列表 废话

Html 使用引导法进行定心是';不行吗? 试图在页面中间集中一行。但是,代码h-100和my auto在我放置它们的任何div上都不起作用 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> <div class="search-page"></div> <div class="container search-items"> <div class="row h-100 justify-content-center searchBar"> <div class="col-sm-8 col-md-8 col-lg-8 col-xl-8"></div> <div class="input-group"> <input type="text" class="form-control col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9" id="search-input" placeholder="" autocomplete="off" required aria-label="Text input with dropdown button"> <input type="text" class="form-control col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3" id="zip-input" placeholder="" onkeypress="return (event.charCode !=8 && event.charCode ==0 || (event.charCode >= 48 && event.charCode <= 57))" required> <div class="input-group-append dropdown-container"> <button class="btn btn-outline-secondary btn-success dropdown-toggle" id="" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button> <div class="dropdown-menu"> <section id="dropDown"> <select class="mdb-select colorful-select dropdown-primary md-form" id="" multiple searchable="Search here.."> <option value="" disabled selected></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> </select> <div class="form-group row"> <div class="col-5"> <input class="form-control" type="number" id="calorie-input" /> </div> <label for="example-number-input" class="col-2 col-form-label" ></label > <!-- End of Calories input --> </section> <!-- End Multiselect Drop down --> </div> </div> </div> <button type="button" id="searchBtn" class="btn btn-success">blah</button> </div> </div> </div> 下拉列表 废话,html,css,twitter-bootstrap,bootstrap-4,Html,Css,Twitter Bootstrap,Bootstrap 4,问题在于您没有为车身或容器指定固定高度,并在搜索栏中使用h-100。所以这个高度:100%将应用于未设置的高度,因此h-100不起作用。 要解决此问题,您可以将vh-100 d-flex align items center justify资源中心添加到body class <body class="vh-100 d-flex align-items-center justify-content-center">...</body> 。。。 d-flex align

问题在于您没有为车身或容器指定固定高度,并在搜索栏中使用h-100。所以这个
高度:100%将应用于未设置的高度,因此h-100不起作用。
要解决此问题,您可以将vh-100 d-flex align items center justify资源中心添加到body class

<body class="vh-100 d-flex align-items-center justify-content-center">...</body>
。。。

d-flex align items center justify content center
类将行显示在页面中心

尝试
vh-100
而不是
h-100
在JsFiddle中添加您的代码提供链接将更容易帮助您