简体   繁体   English

正文和内容div高度100(自举4)+角度

[英]body and content div height 100 in bootstrap 4 + angular

I want to set <div class="card"> center of page or body, It work perfect on desktop browser but, in mobile view not work, i can set it on center using... 我想设置<div class="card">页面或正文的中心,它在桌面浏览器上完美运行,但是,在移动视图下不起作用,我可以使用...在中心设置它。

html, body {
  height: 100%;
  background: linear-gradient(to top right, #fc2c77 0%, #6c4079 100%);
}

and

h-100, H-100,

align-items-center h-100 align-items-center h-100

<div class="container h-100">
  <div class="row align-items-center h-100 pt-5 pb-5">
    <form class="col-12 wow fadeInUp " data-wow-delay="0.2s">
      <div class="card"> 
       ...
      </div>
    </form>
  </div>
</div>

it work perfect on desktop browser 它在桌面浏览器上完美工作 在此处输入图片说明

but in mobile view form cut from top and bottom and body repeat at scroll 但在移动视图中, 从顶部和底部切出的表单以及正文在滚动时重复

在此处输入图片说明

To prevent your form from cutting, add display:table , or display:grid to your parent .container: 为了防止表单被剪切,请在您的父容器中添加display:tabledisplay:grid

<div class="container h-100 "style="display:grid">...</div> or: <div class="container h-100 d-table">...</div> <div class="container h-100 "style="display:grid">...</div>或: <div class="container h-100 d-table">...</div>

Regarding the linear-gradient repeating at body scroll, make sure your html and body fill the page: 关于在正文滚动处重复的线性渐变,请确保您的htmlbody填充页面:

body { min-height: 100%; overflow: auto; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM