html div 100%,HTML基础知识:为什么div不能缩放到100%(HTML Basics: Why is div not scaling to 100%)...

HTML基础知识:为什么div不能缩放到100%(HTML Basics: Why is div not scaling to 100%)

我没有看到任何理由为什么这个片段不能扩展到100%的屏幕...有谁知道...我想是这样的...我只是不明白它在这里一个小提琴: http:/ /jsfiddle.net/uuzbv/

Untitled Document

body{

width:100%;

height:100%;}

.section{

height:100%;

width:100%;

background-color:#000;

}

I don't see any reason why this snippet doesn't scale to 100 percent of the screen...does anyone know...i guess so...I just don't get it and here a fiddle: http://jsfiddle.net/uuzbv/

Untitled Document

body{

width:100%;

height:100%;}

.section{

height:100%;

width:100%;

background-color:#000;

}

原文:https://stackoverflow.com/questions/9333925

更新时间:2019-12-01 10:10

最满意答案

使用:

body, html {

width:100%;

height:100%;

}

Use:

body, html {

width:100%;

height:100%;

}

相关问答

使用: body, html {

width:100%;

height:100%;

}

Use: body, html {

width:100%;

height:100%;

}

如果您是html2canvas的新手,我将在下面介绍一些可以帮助您入门的样板代码。 希望它可以帮助别人。

test2

你可以这样翻译: var geometry= new THREE.CircleGeometry(0.05, 10, 0, Math.PI/2);

var translation = new THREE.Matrix4().makeTranslation(10, 0, 0);

geometry.applyMatrix(translation);

You can make a translation like this: var geometry= new THREE.CircleGeometry(

...

你只需要使用box-sizing:border-box html,

body {

height: 100%;

margin: 0

}

.blah {

display: flex;

flex-direction: column;

justify-content: center;

text-align: center;

background: #ffb3b3;

min-height: 100%;

padding: 10% 0;

box-

...

通过将每个div设置为position: fixed ,将每个div相对于视口放在彼此的顶部。 删除.overlay类,然后将它们显示在另一个下面。 如果你想一次只在屏幕上有一个没有滚动条,你就不得不求助于使用JavaScript。 这里有一个示例的链接,其中一个跟随另一个http://jsbin.com/UvOXUXI/1/ By setting each div to position: fixed you put each one of them on top of one another,

...

绝对位置的默认值是将left和top设置为0 ,以获得一个div在另一个下面,因为它们不在文档流中,或者使用相对位置(这会导致与空元素的其他问题,身体没有位置等): #second{

position:absolute;

top: 100%;

width:100%;

height:100%;

background:yellow;

}

小提琴 The default for position absolute is to set left and top

...

更换margin-left:-300px; right: calc(50% + 250px); 在.innerleft然后添加left: calc(50% + 250px); 到.innerright就可以了。 这里要做的是我将div的左侧和右侧的距离设置为通过调整页面大小或缩放页面无法更改的距离。 计算结果是侧面的50%,+中心div宽度的50%。 此解决方案仅在您具有不能/不会更改的中心div的静态宽度时才有效。 在这里小提琴 Replacing margin-left:-300px; wit

...

当你有一个viewBox时,内容将(默认情况下)尝试保持viewBox的宽高比。 您可以通过preserveAspectRatio =“none”禁用此功能。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值