简体   繁体   English

如何使容器充满整个页面? 也要回应

[英]How do I make a container fill the whole page? Also to be responsive

I have different sections like "About me", "Contact", "Photo gallery" etc, and I want that when I open the site, the "About me" container to be displayed on the whole page, to fill the page without any content from the next section to appear. 我有不同的部分,例如“关于我”,“联系人”,“照片库”等,我希望当我打开网站时,“关于我”容器将显示在整个页面上,以填充页面而没有任何内容内容将从下一部分出现。

<div class="container-fluid bg-2 text-left">
 <div id="About me">
  <h1 class="margin">About me</h1>
  <p> My text here</p>
 </div>
</div>

I have the "container-fluid" class for every container with content in the index file. 对于索引文件中包含内容的每个容器,我都有一个“容器流体”类。

.container-fluid {
  padding-top: 70px;
  padding-bottom: 70px;
}

Any idea would be greatly appreciated! 任何想法将不胜感激!

That should addapt to the width of the browser at every state. 这应该增加每种状态下浏览器的宽度。

.container-fluid {
width:100%
padding:70px 0px 70px 0px;
}

You could use viewport relative units . 您可以使用视口相对单位

.example {
  min-height: 100vh;
  min-width: 100vw;
}

give the about container a height:100vh; width:100%; 给容器大约height:100vh; width:100%; height:100vh; width:100%;

 .container-fluid {
     width:100%
     padding:70px 0px 70px 0px;
     margin :0;
  }

If above code not work write !important as like padding:70px 0px 70px 0px!important; 如果上面的代码不起作用,请像填充这样写!important:70px 0px 70px 0px!important; Sometimes old style not override by new style so you make it important by writing above statement. 有时旧样式不会被新样式覆盖,因此您可以通过编写上述声明来使其变得重要。

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

相关问题 如何让容器填满 React 中的整个页面? - How do I make a Container fill the whole page in React? 如何在React JS中使整个容器响应 - How to make whole container responsive in react js 我的页面高度没有填满整个高度? 如何让它响应? - My height for my page does not fill full height? How do I make it responsive? iOS ui隐藏页面的底部。 当隐藏和显示iOS底部菜单时,如何使整个页面具有响应性并且底部始终可见? - iOS ui hides the bottom of the page. How do I make the whole page responsive and its bottom always visible when iOS bottom menu is hidden and shown? 使画布填满整个页面 - Make canvas fill the whole page 如何使这个响应移动视图? 并为电视节目 div 提供间距 - How do I make this responsive for mobile view? and also provide spacing for tv show div 如何使所有容器大小相同以及如何以正确的方式设置图像? - How do I make all the container sizes same and also how to set the images in a proper way? 使列表的高度填满整个页面 - Make height of list fill whole page 使div填充整个页面的高度 - Make a div fill the whole page in height 当它是当前页面时,如何使当前的导航链接也处于活动状态? - How do i make current nav link which is also home page active when it's the current page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM