严格来说,100%是什么? [英] STRICTly speaking, what is 100%?

查看:65
本文介绍了严格来说,100%是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个页面:三个部分(左,顶部和

底部),每个部分都有标题和滚动(溢出)内容。

这些部分的大小应基于用户在浏览器中可查看区域的大小。我很接近......非常接近,但是我很难相信如何将特定测量与百分比混合。


当我开始时,事情非常好:

http:// play .psmonopoly.com / autosize.html)。在IE浏览器中有点笨拙,但

firefox和两者都运行良好。

然后我开始尝试为每个部分添加1em高标题,添加

一些小的利润和填充,一切都走下坡路

http://play.psmonopoly.com/autosize1.html)


有人可以解释100%的真正含义,并且有办法吗? br />
100%表示所有可用区域减去父级的填充

容器?


谢谢!


迈克

解决方案

Mike写道:

有人可以解释100%的真正含义,


这意味着100%的内容区域

http://www.w3.org/TR/REC-CSS2/box.html

并且就在那里一种方式
100%表示所有可用区域减去父级
容器的填充?




仅在IE中:)


-

Brian O''Connor(ironcorona)


ironcorona写道:
< blockquote class =post_quotes>

是否有一种方法
100%表示所有可用区域减去父级
容器的填充?




对不起,我刚读完了。这正是它的意思。如果我将

元素的宽度设置为100%,它将占用其所有*元素的

内容区域。
< br $>
-

Brian O''Connor(ironcorona)


Mike写道:

有人可以解释100%真正意味着什么,并且有没有办法说100%意味着所有可用区域减去父级
容器的填充?




这取决于你所谈论的属性。


在高度的情况下,它意味着和容器一样高,提供

容器不是高度:auto在这种情况下它变为高度:auto

而不是。


在宽度的情况下它意味着究竟它听起来像什么,但请记住

宽度是_content_宽度,填充,边框和边距去外面是



对于显示的元素:block,auto的宽度为&qu ot;无论空间是什么空间

在边界,边距和填充之后遗留下来。


-

David Dorward < HTTP://blog.dorward.me.uk/> < http://dorward.me.uk/>

首页是〜/ .bashrc的位置


I''m trying to create a page: Three sections (left, topright and
bottomright), each with a heading and scrolling (overflow) content.
The size of these sections should be based upon the size of the user''s
viewable area in their browser. I''m close... really close, but I''m
confused over how to mix specific measurements with percentages.

When I began, things were quite nice:
(http://play.psmonopoly.com/autosize.html). A little clunky in IE, but
firefox and ie both worked pretty well.
Then I started trying to add a 1em high heading for each section, add
some small margins and padding and everything went downhill
(http://play.psmonopoly.com/autosize1.html).

Can someone please explain what 100% really means, and is there a way
that 100% means all the area available minus the padding of the parent
container?

Thanks!

Mike

解决方案

Mike wrote:

Can someone please explain what 100% really means,
It means 100% of the content area

http://www.w3.org/TR/REC-CSS2/box.html
and is there a way
that 100% means all the area available minus the padding of the parent
container?



Only in IE :)

--
Brian O''Connor (ironcorona)


ironcorona wrote:

and is there a way
that 100% means all the area available minus the padding of the parent
container?



Sorry, I just re-read that. That''s exactly what it means. If I set an
element''s width to 100% it will take up *all* of its parent element''s
content area.

--
Brian O''Connor (ironcorona)


Mike wrote:

Can someone please explain what 100% really means, and is there a way
that 100% means all the area available minus the padding of the parent
container?



It depends what property you are talking about.

In the case of height it means "As tall as the container, providing the
container is not height: auto in which case it becomes height: auto
instead".

In the case of width it means exactly what it sounds like, but remember that
the width is the _content_ width and that padding, border and margin go
outside it.

On elements that are display: block, a width of auto is "whatever space is
left over after border, margin and padding are accounted for".

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


这篇关于严格来说,100%是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆