Div高度...... [英] Div heights...

查看:54
本文介绍了Div高度......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...


我有一个问题,其中嵌套< div>并没有改变它的b / b
父div的高度。我有一个父div,其中包含一个子div和一些文本。

子div是一个用于保存缩略图列表的框。如果缩略图

div中有多个图像,它会溢出父div。我如何制作

这个div会影响父div的高度?

我有以下HTML:


< div>

< h3>某些标题或其他...< / h3>

< div class ="缩略图">

< p>< img src =" images / images / thumb_page_02_01_01.jpg" alt =""

width =" 75"高度= QUOT; 51" border =" 0">< / p>

< p>< img src =" images / images / thumb_page_02_01_02.jpg" alt =""

width =" 75"高度= QUOT; 49" border =" 0">< / p>

< p>< img src =" images / images / thumb_page_02_03_01.jpg" alt =""

width =" 75"高度= QUOT; 110" border =" 0">< / p>

< p>< img src =" images / images / thumb_page_02_01_01.jpg" alt =""

width =" 75"高度= QUOT; 51" border =" 0">< / p>

< p>< img src =" images / images / thumb_page_02_01_02.jpg" alt =""

width =" 75"高度= QUOT; 49" border =" 0">< / p>

< p>< img src =" images / images / thumb_page_02_03_01.jpg" alt =""

width =" 75"高度= QUOT; 110" border =" 0">< / p>

< / div>

一些供人阅读的文字......供人阅读的文字。 ..一些

文本供人们阅读...有些文字可供人们阅读...有些文字供

人们阅读...有些文字供人们阅读阅读...一些文字给人们

阅读...一些文字供人们阅读...一些文字供人们阅读...一些

文字为人们阅读......有些文字可供人们阅读......有些文字可供人们阅读......有些文字可供人们阅读......有些文字可供人们阅读

阅读...

< / div>

以下样式表:


div.thumbnails {

浮动:正确;

}


div.thumbnails p {

保证金:5px 0 5px 0;

}

Hi...

I have a problem where a nested <div> isn''t changing the height of its
parent div. I have a parent div which contains a child div and some text.
The child div is a box to hold a list of thumbnail images. If the thumbnail
div has several images in it, it overflows the parent div. How can I make
this div affect the height of the parent div?
I have the following HTML:

<div>
<h3>Some title or other...</h3>
<div class="thumbnails">
<p><img src="images/images/thumb_page_02_01_01.jpg" alt=""
width="75" height="51" border="0"></p>
<p><img src="images/images/thumb_page_02_01_02.jpg" alt=""
width="75" height="49" border="0"></p>
<p><img src="images/images/thumb_page_02_03_01.jpg" alt=""
width="75" height="110" border="0"></p>
<p><img src="images/images/thumb_page_02_01_01.jpg" alt=""
width="75" height="51" border="0"></p>
<p><img src="images/images/thumb_page_02_01_02.jpg" alt=""
width="75" height="49" border="0"></p>
<p><img src="images/images/thumb_page_02_03_01.jpg" alt=""
width="75" height="110" border="0"></p>
</div>
Some text for people to read... Some text for people to read... Some
text for people to read... Some text for people to read... Some text for
people to read... Some text for people to read... Some text for people to
read... Some text for people to read... Some text for people to read... Some
text for people to read... Some text for people to read... Some text for
people to read... Some text for people to read... Some text for people to
read...
</div>
And the following stylesheet:

div.thumbnails {
float : right;
}

div.thumbnails p {
margin : 5px 0 5px 0;
}


推荐答案

Plankmeister写道:
The Plankmeister wrote:
嗨...

我有一个问题,其中嵌套< div>并没有改变它的父级div的高度。我有一个父div包含一个子div和一些文本。
子div是一个容纳缩略图列表的框。如果缩略图
div中有几个图像,它会溢出父div。我如何使这个div影响父div的高度?


[...]

div.thumbnails {
float:right;
}
Hi...

I have a problem where a nested <div> isn''t changing the height of its
parent div. I have a parent div which contains a child div and some text.
The child div is a box to hold a list of thumbnail images. If the thumbnail
div has several images in it, it overflows the parent div. How can I make
this div affect the height of the parent div?
[...]
div.thumbnails {
float : right;
}




float从正常流程中取出块,因此计算父块的高度也不相关

。在浮动的div之后你应该添加一个块

和'clear:right'。

-

Johannes Koch

in te domine speravi;非永久性的东西。

(Te Deum,4美分。)



float takes the block from the normal flow, so that it is nor relevant
for the calculation of the parent block''s height. You should add a block
with ''clear: right'' after the floated divs.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Plankmeister写道:
The Plankmeister wrote:
我有一个问题,其中嵌套< div>并没有改变它的父级div的高度。
div.thumbnails {
float:right;
}
I have a problem where a nested <div> isn''t changing the height of its
parent div. div.thumbnails {
float : right;
}



http://www.complexspiral.com/publica...aining-floats/


-

David Dorward http://dorward.me.uk/


http://www.complexspiral.com/publica...aining-floats/




这正是我追求的是什么。一千个大人物!

P.



That is precisely what I was after. A thousand thankyous!
P.


这篇关于Div高度......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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