使div与另一个相同 [英] making div's the same size as one another

查看:104
本文介绍了使div与另一个相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.frostjedi.com/terra /scrip.../samesize.html


我想让inner1和inner2具有相同的高度但不是

确定如何。我不想明确地设置px中的高度或任何类似的东西

因为那将要求你计算多少px高

将会是什么提前。此外,这可能会破坏

浏览器,这些浏览器可能会使文字变得更大,对于有视觉障碍的人来说会有问题。


将高度设置为100%似乎无法正常工作......


将显示设置为表格单元或类似的东西似乎是

可能有效,但我不认为IE会识别表格单元格...


有什么想法吗?

http://www.frostjedi.com/terra/scrip.../samesize.html

I''d like to make inner1 and inner2 have the same height but am not
sure how. I don''t want to explicitly set a height in px or anything
like that because that''d require you calculate how many px tall
something is going to be in advance. Also, that''s likely to break
browsers that might make the text bigger for people with vision
problems or something.

Setting height to 100% doesn''t seem to work, either...

Setting display to table-cell or something like that seems like it
might work, but I don''t think IE recognizes table-cell...

Any ideas?

推荐答案

文章

< 11 ********************** @ k79g2000hse.googlegroups。 com>,

yawnmoth< te ******* @ yahoo.comwrote:
In article
<11**********************@k79g2000hse.googlegroups .com>,
yawnmoth <te*******@yahoo.comwrote:
http://www.frostjedi.com/terra/scrip.../samesize.html


我想让inner1和inner2具有相同的高度但不是

确定如何。我不想明确地设置px中的高度或任何类似的东西

因为那将要求你计算多少px高

将会是什么提前。此外,这可能会破坏

浏览器,这些浏览器可能会使文字变得更大,对于有视觉障碍的人来说会有问题。


将高度设置为100%似乎无法正常工作......


将显示设置为表格单元或类似的东西似乎是

可能有用,但我不认为IE会识别表格单元格...


有什么想法吗?
http://www.frostjedi.com/terra/scrip.../samesize.html

I''d like to make inner1 and inner2 have the same height but am not
sure how. I don''t want to explicitly set a height in px or anything
like that because that''d require you calculate how many px tall
something is going to be in advance. Also, that''s likely to break
browsers that might make the text bigger for people with vision
problems or something.

Setting height to 100% doesn''t seem to work, either...

Setting display to table-cell or something like that seems like it
might work, but I don''t think IE recognizes table-cell...

Any ideas?



嗯,本着你准备设置宽度的精神(尽管我已经使得宽度更宽松了一些文字扩展):

http://tinyurl.com/ys95qs


只是在玩。放松每个人。


否则请参阅


< http://tinyurl.com/2wktfv>


-

dorayme

Well, in the spirit of your preparedness to set widths (though I
have made the widths a bit more text-expansion-friendly):

http://tinyurl.com/ys95qs

Just playing. Relax everyone.

Otherwise see

<http://tinyurl.com/2wktfv>

--
dorayme


dorayme写道:
dorayme wrote:

嗯,本着你准备设置宽度的精神(尽管我已经使宽度更加文字扩展了):

http://tinyurl.com/ys95qs



差不多。不幸的是,只有当最左边的DIV包含最多

的内容时才有效。


-

小心,


Jonathan

-------------------

LITTLE WORKS STUDIO http://www.LittleWorksStudio.com


在文章< 36 ************************** @ NAXS.COM>,

Jonathan N. Little < lw ***** @ centralva.netwrote:
In article <36**************************@NAXS.COM>,
"Jonathan N. Little" <lw*****@centralva.netwrote:

dorayme写道:
dorayme wrote:

嗯,本着你准备设置宽度的精神(尽管我已经使宽度更加文字扩展了):

http://tinyurl.com/ys95qs



差不多。不幸的是,只有当最左边的DIV包含最多的
内容时才有效。


Almost. Unfortunately only works if the left most DIV contains the most
content.



是的,它需要有信心的远见,对于

模板没有多少印章...< g>

如果可以轻松获取一个元素的维度,并且选择另一个元素的高度,则可以选择
。我想,

就是JS的用武之地...


无论如何,有各种各样的方法可以让cols等于

外观,讨论很多。对我自己来说,我很少能获得

的动力。一个人可以设计它看起来不奇怪的地方

cols是不同的高度,甚至看起来像cols

特别是......


-

dorayme

Yes it requires confident foresight, not much chop for a
template... <g>

Be nice if the dimension of one element could be taken easily and
by choice to be the height of a different element. I suppose that
is where JS comes in...

Anyway, there are all sorts of ways of making cols equal in
appearance, much discussed. For myself, I can rarely get the
motivation. One can design where it simply does not look odd for
cols to be different heights, nor even look like cols
particularly...

--
dorayme


这篇关于使div与另一个相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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