[英]How do I adjust the content in a page to only take up screen width?
Using dev tools my content shrinks at lower bps.使用开发工具,我的内容会以较低的 bps 缩小。 Everything from my header nav to footer is inside a container.
从我的 header 导航到页脚的所有内容都在容器内。 Container is set to:
容器设置为:
.container {
width: 800px;
margin: 0 auto;
border: 2px solid green;
}
At 800px, I have a horizontal scroll and the content shrinks, adding space to the bottom of the footer.在 800 像素处,我有一个水平滚动并且内容缩小,在页脚底部增加了空间。 Using a media query, how could I fill the screen with the container?
使用媒体查询,我怎样才能用容器填充屏幕? screen at 788 bp
788 bp 屏幕
width:100%
this will make the container div to take-up all of the viewport. width:100%
这将使容器 div 占据所有视口。
I think what you want is width: 100%
and max-width: 800px
.我认为您想要的是
width: 100%
和max-width: 800px
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.