Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.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 带引导4的垂直中心不工作_Html_Angular_Bootstrap 4 - Fatal编程技术网

Html 带引导4的垂直中心不工作

Html 带引导4的垂直中心不工作,html,angular,bootstrap-4,Html,Angular,Bootstrap 4,我试图使用bootstrap 4集中一个面板,我使用的是align items center,但没有成功。我已经添加了h-100,仍然在页面顶部继续使用标题。有人知道会出什么问题吗?我用的是带引导的angular 4 <div class='container h-100'> <div class='row h-100 justify-content-center align-items-center'> <div class='mx-auto col-

我试图使用bootstrap 4集中一个面板,我使用的是align items center,但没有成功。我已经添加了h-100,仍然在页面顶部继续使用标题。有人知道会出什么问题吗?我用的是带引导的angular 4

<div class='container h-100'>
  <div class='row h-100 justify-content-center align-items-center'>
    <div class='mx-auto col-sm-6' style="border: 2px solid red"  >
      <h3 class="text-center">Título da Aplicação</h3>
      <h4 class="text-center">Subtítulo da Aplicação</h4>
    </div>
  </div>
</div>

蒂图罗-达阿皮卡ção
阿皮卡ção海滩酒店

`你的想法是对的!问题是
h-100
类添加了一个
高度规则:100%
,并且容器继承的父级上没有固定的

为了解决这个问题,我建议从
.container
中删除
h-100
类,并手动指定
高度
,表示视口高度的
100%

.container{
高度:100vh;
}

蒂图罗-达阿皮卡ção
阿皮卡ção海滩酒店

Tks,黑曜石。工作得很好,太棒了;很乐意帮忙!一旦你确认这解决了你的问题,请不要忘记点击投票按钮下方的灰色复选框——这会将其从“未回答问题”队列中删除,并为提问者和回答问题者赢得声誉。你可以在提出任何问题15分钟后这样做。当然,在这样说的时候,你没有义务将我的答案(或其他人的答案)标记为正确,尽管将问题标记为已解决有助于保持事情顺利进行:)