调整DIV的大小以填充页面的整个高度?请帮忙 [英] Resize a DIV to fill entire height of page? Please help

查看:72
本文介绍了调整DIV的大小以填充页面的整个高度?请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将DIV标记的大小调整到页面的整个高度。对于我来说,这似乎不应该是非常困难的,但是,唉,它打败了我。 div中的内容可能是表格,图像等。

dyanmic。


身高:100%不起作用。


是否有我可以添加的javascript代码,这将使容器DIV

页面的高度? (不是视口)

解决方案

ShutterMan于2008年1月25日在comp.lang.javascript中写道
< blockquote class =post_quotes>
我需要将DIV标签的大小调整到整个页面高度。对于我来说,这似乎不应该是非常困难的,但是,唉,它打败了我。 div中的内容可能是表格,图像等。

dyanmic。


身高:100%不起作用。


是否有我可以添加的javascript代码,这将使容器DIV

页面的高度? (不是视口)



html中的视口是什么?


< body style =''padding:0;保证金:0;''>

< div>

< / div>

< / body>


会的。


不需要JS。


-

Evertjan 。

荷兰。

(请在我的电子邮件地址中将x'变为点数)


Evertjan 。在2008年1月25日凌晨4:02发表以下内容:


ShutterMan于2008年1月25日在comp.lang.javascript中写道


>我需要将DIV标签的大小调整到整个页面高度。对于我来说,这似乎不应该是非常困难的,但唉,它打败了我。 div中的内容可能是表格,图像等
dyanmic。

高度:100%不起作用。

是否有我可以添加的javascript代码使容器DIV页面的高度? (不是视口)



html中的视口是什么?


< body style =''padding:0;保证金:0;''>

< div>

< / div>

< / body>


会的。


不需要JS。



这不是如果页面中有其他

元素,则div与页面的高度相同:


< div> Div 1< / div>

< div> Div 2< / div>

< div>第一个div只有一行高< / div>

< div> OP希望第一个div与整个页面的高度相同

< / div>

< div>可能要进行列类型菜单布局< / div> ;


-

兰迪

机会有利于准备好的心灵

comp.lang.javascript常见问题 - http://jibbering.com/faq/index.html

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/


Randy Webb于2008年1月25日在comp.lang.javascript中写道


Evertjan。在2008年1月25日凌晨4:02发表以下内容:


> ShutterMan于2008年1月25日在comp.lang.javascript中写道


>>我需要将DIV标签的大小调整到整个页面高度。对于我来说,这似乎不应该是非常困难的,但唉,它打败了我。 div中的内容可能是表格,图像等
dyanmic。

高度:100%不起作用。

是否有我可以添加的javascript代码使容器DIV页面的高度? (不是视口)


html中的视口是什么?

< body style =''padding:0; margin:0;''>
< div>
< / div>
< / body>

会做。

不需要JS。



这不会使div与页面的高度相同



确实如此。


如果你有其他



总有一个if,但我的上面的代码是正确的。
页面中的


元素:


< div> Div 1< / div>

< div> Div 2< / div>

< div>第一个div只有一行高< / div>

< div> OP想要第一个div与整个页面相同的高度

< / div>

< div>可能要进行列类型菜单布局< / div>



猜测OP看起来不是很有用,

当OP可以告诉他/她自己。


-

Evertjan。

荷兰。

(请将x''改为我的点数emailaddress)


Im needing to resize a DIV tag to the entire height of the page. To
me, this doesnt seem like it should be very difficult, but alas, its
beating me. The content within the div may be tables, images, etc
dyanmic.

height: 100% doesnt work.

Is there javascript code I can add that will make the container DIV
the height of the page? (not viewport)

解决方案

ShutterMan wrote on 25 jan 2008 in comp.lang.javascript:

Im needing to resize a DIV tag to the entire height of the page. To
me, this doesnt seem like it should be very difficult, but alas, its
beating me. The content within the div may be tables, images, etc
dyanmic.

height: 100% doesnt work.

Is there javascript code I can add that will make the container DIV
the height of the page? (not viewport)

what is a viewport in html?

<body style=''padding:0;margin:0;''>
<div>
</div>
</body>

will do.

No JS needed.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


Evertjan. said the following on 1/25/2008 4:02 AM:

ShutterMan wrote on 25 jan 2008 in comp.lang.javascript:

>Im needing to resize a DIV tag to the entire height of the page. To
me, this doesnt seem like it should be very difficult, but alas, its
beating me. The content within the div may be tables, images, etc
dyanmic.

height: 100% doesnt work.

Is there javascript code I can add that will make the container DIV
the height of the page? (not viewport)


what is a viewport in html?

<body style=''padding:0;margin:0;''>
<div>
</div>
</body>

will do.

No JS needed.

That doesn''t make the div the same height as the page if you have other
elements in the page:

<div>Div 1</div>
<div>Div 2</div>
<div>The first div is only one line high</div>
<div>The OP wants the first div to be the
same height as the entire page</div>
<div>Probably to do a column type menu layout</div>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Randy Webb wrote on 25 jan 2008 in comp.lang.javascript:

Evertjan. said the following on 1/25/2008 4:02 AM:

>ShutterMan wrote on 25 jan 2008 in comp.lang.javascript:

>>Im needing to resize a DIV tag to the entire height of the page. To
me, this doesnt seem like it should be very difficult, but alas, its
beating me. The content within the div may be tables, images, etc
dyanmic.

height: 100% doesnt work.

Is there javascript code I can add that will make the container DIV
the height of the page? (not viewport)


what is a viewport in html?

<body style=''padding:0;margin:0;''>
<div>
</div>
</body>

will do.

No JS needed.


That doesn''t make the div the same height as the page

It does.

if you have other

There is always an if, but my above code is correct.

elements in the page:

<div>Div 1</div>
<div>Div 2</div>
<div>The first div is only one line high</div>
<div>The OP wants the first div to be the
same height as the entire page</div>
<div>Probably to do a column type menu layout</div>

Guessing what the OP ment seems not very usefull,
when the OP is avialable to tell him/herself.

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于调整DIV的大小以填充页面的整个高度?请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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