如何让div成为内容的全部高度? [英] How do I get the div to be the full height of the contents?

查看:71
本文介绍了如何让div成为内容的全部高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


请查看 http://www.kidsinaction.org.uk/fd2/x.html


在FF中,它看起来我想要的,但这需要我在页面的第一个ul之后添加额外的

div(idof ferret)。我认为这是如此的b / b
会有一些东西需要清除,这使得id为id / / $
" sectionlinks"足够高。我确定有更好的方法来做这个比这更好的了!


即使没有更好的方法,它也没有在IE中工作(惊喜)因为

IE坚持给予雪貂。 div高度,即使我将它设置为

为零。


有关如何解决此问题的任何建议?理想情况下,我希望

页面看起来像现在在FF中,但不需要额外的div。

我确定这可以做到,我只是不知道怎么样;-)


顺便说一下,页面还有一些问题,比如字体

尺寸是边缘太小等等。请不要大声喊我这个,我还在试验它!此外,顶部的空白区域

是一个标题,我将其从HTML中删除以缩短它。


TIA以获得任何帮助。


-

Alan Silver

(此行下方添加的任何内容都与我无关)

Hello,

Please look at http://www.kidsinaction.org.uk/fd2/x.html

In FF, it looks how I would like, but this required me to add an extra
div (id of "ferret") after the first ul in the page. I think this was so
that there would be something to clear, which made the div with id
"sectionlinks" be high enough. I''m sure that there is a better way to do
it than this!!

Even if there wasn''t a better way, it doesn''t work in IE (surprise) as
IE insists on giving the "ferret" div a height, even though I set it to
be zero.

Any suggestions on how to fix this? Ideally, I would like to have the
page looking like it does now in FF, but without needing the extra div.
I''m sure this can be done, I just don''t know how ;-)

By the way, there are still a few issues with the page, such as font
sizes being too small in the margin, etc. Please don''t shout at me for
this, I''m still experimenting with it!! Also, the blank space at the top
is for a header which I chopped out of the HTML to make it shorter.

TIA for any help.

--
Alan Silver
(anything added below this line is nothing to do with me)

推荐答案

在文章< Tb ************** @ nospamthankyou.spam> ;,Alan Silver

<人********* @ nospam.thanx.invalid>写道
In article <Tb**************@nospamthankyou.spam>, Alan Silver
<al*********@nospam.thanx.invalid> writes
你好,




如果它有帮助,我已经添加了第二个版本的页面,这次是

没有额外的div,所以你可以看到发生了什么。理想情况下,我希望
能够在不添加额外(不需要的)

内容的情况下获得高度。

http://www.kidsinaction.org.uk/fd2/y.html


具有讽刺意味的是,这个版本看起来几乎是我想要的IE浏览器,但很糟糕

FF !!


TIA


-

Alan Silver

(此行下面添加的任何内容都与我无关)



In case it helps, I have added a second version of the page, this time
without the extra div, so you can see what is happening. Ideally, I
would like to get the height working without adding extra (unneeded)
content.

http://www.kidsinaction.org.uk/fd2/y.html

Ironically, this version looks almost how I want it in IE, but lousy in
FF!!

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)


Alan Silver写道:
Alan Silver wrote:

请看 http://www.kidsinaction.org.uk/fd2/x.html

在FF中,它看起来我想要的,但这要求我在页面的第一个ul之后添加一个额外的
div(idof ferret)。我认为这是如此
以便有一些东西要清除,这使得div具有id
sectionlinks足够高。我确定有更好的方法来做它比这更好!!

Please look at http://www.kidsinaction.org.uk/fd2/x.html

In FF, it looks how I would like, but this required me to add an extra
div (id of "ferret") after the first ul in the page. I think this was so
that there would be something to clear, which made the div with id
"sectionlinks" be high enough. I''m sure that there is a better way to do
it than this!!



见< http://positioniseverything.net/easyclearing.html>。


-

jmm(连字符)列表(at)sohnen-moe(点)com

(删除.AXSPAMGN for电子邮件)


See <http://positioniseverything.net/easyclearing.html>.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)




" Alan Silver" <人********* @ nospam.thanx.invalid>在留言中写道

新闻:Tb ************** @ nospamthankyou.spam ...

"Alan Silver" <al*********@nospam.thanx.invalid> wrote in message
news:Tb**************@nospamthankyou.spam...

请看一下 http://www.kidsinaction.org.uk/fd2/x。 html

即使没有更好的方法,它也不会在IE(惊喜)中工作,因为IE
坚持要给予雪貂。 div高度,即使我把它设置为零。

有关如何解决此问题的任何建议吗?

Please look at http://www.kidsinaction.org.uk/fd2/x.html

Even if there wasn''t a better way, it doesn''t work in IE (surprise) as IE
insists on giving the "ferret" div a height, even though I set it to be
zero.

Any suggestions on how to fix this?




Put雪貂div里面的评论。


ie。


< div id =" ferret"><! - - - >< / div>


我不知道它为什么会起作用,但是我用它来加载IE上特定的图表web

app


HTH,


Martin



Put a comment inside the ferret div.

ie.

<div id="ferret"><!-- --></div>

don''t know why it works, but I use it loads to do graphs on IE specific "web
apps"

HTH,

Martin


这篇关于如何让div成为内容的全部高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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