内联div的问题 [英] problems with inline divs

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

问题描述

http://www.frostjedi.com/terra/dev /test.html


我想让彩色框出现在与测试相同的行上。

。包含彩色框的div被定义为内联,

但似乎并不是一个内联元素。我怀疑在div中的图像中浮动的

可能会导致问题,

但我不知道怎么办,如果那是'案子。任何想法?

http://www.frostjedi.com/terra/dev/test.html

I''d like to have the colored boxes appear on the same line as "Test"
does. The div containing the colored boxes is defined as being inline,
yet doesn''t seem to be acting as an inline element. I suspect the
floats in the images within the div may be contributing to the problem,
but I don''t know what to do about it if that''s the case. Any ideas?

推荐答案

yawnmoth写道:
yawnmoth wrote:
http://www.frostjedi.com/terra/dev/test.html

我想让彩色框出现在与测试相同的行上。
。包含彩色框的div被定义为内联,但似乎并不像内联元素那样。我怀疑div中图像中的
浮动可能导致问题,


浮动元素是块级元素。

块级别元素不能被内联元素所包含。

但我不知道该怎么办,如果是这样的话。任何想法?
http://www.frostjedi.com/terra/dev/test.html

I''d like to have the colored boxes appear on the same line as "Test"
does. The div containing the colored boxes is defined as being inline,
yet doesn''t seem to be acting as an inline element. I suspect the
floats in the images within the div may be contributing to the problem,
Floating elements are block level elements.
Block level elements can''t be contained by inline elements.
but I don''t know what to do about it if that''s the case. Any ideas?




在您的代码中,您在浮动之前有单词Test。我想知道你的目标是什么

:右边是彩色的方框,还是文本左边的



如果到了左边,你应该把它们放在文本之前。

如果你想让他们直接在右边跟着文字,

我会把''文字' '在一个div中,然后向左漂浮,然后是彩色的

盒子,也向左漂浮。


-

Els http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -



In your code you have the word Test before the floats. I wonder what
your objective is: have the coloured boxes to the right, or to the
left of the text?
If to the left, you should place them before the text.
If you want them to follow the word text directly on the right side,
I''d put ''Text'' in a div, and float it left, followed by the coloured
boxes, floated left as well.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -





Els写道:


Els wrote:
yawnmoth写道:
yawnmoth wrote:
http://www.frostjedi.com/terra/dev/test.html

< snip>
http://www.frostjedi.com/terra/dev/test.html

<snip>


如果你想要他们在右侧直接跟着文字,
我会把''文字''放在一个div中,然后向左漂浮,然后是彩色的
框,也向左漂浮。


If you want them to follow the word text directly on the right side,
I''d put ''Text'' in a div, and float it left, followed by the coloured
boxes, floated left as well.




达到了预期的效果 - 谢谢!


虽然现在vertical-align似乎无法正常工作。我想要测试的

底部。文本与右侧多重div的

底部具有相同的垂直位置。任何想法?



That achieved the desired effect - thanks!

Although now vertical-align doesn''t seem to be working. I''d like the
bottom of the "Test" text to have the same vertical position as the
bottom of the multicored div to the right. Any ideas?


yawnmoth写道:
yawnmoth wrote:
Els写道:
yawnmoth写道:
yawnmoth wrote:
http:/ /www.frostjedi.com/terra/dev/test.html

< snip>
http://www.frostjedi.com/terra/dev/test.html

<snip>


如果您希望他们直接关注文字右边,
我会把''Text''放在一个div中,然后向左漂浮,然后是彩色的
盒子,左边也是浮动的。


If you want them to follow the word text directly on the right side,
I''d put ''Text'' in a div, and float it left, followed by the coloured
boxes, floated left as well.


<这取得了预期的效果 - 谢谢!

虽然现在垂直对齐似乎并没有起作用。我想要测试的底部。文本与右侧多重div的底部具有相同的垂直位置。任何想法?



That achieved the desired effect - thanks!

Although now vertical-align doesn''t seem to be working. I''d like the
bottom of the "Test" text to have the same vertical position as the
bottom of the multicored div to the right. Any ideas?




不确定 - 我猜测设置vertical-align:bottom;用于测试将

将文本降低到块的级别。


如果彩色框只是图像:不要漂浮任何东西,只需去

测试< img src =" ..">< img src =" ..">< img .... ...>

这将使图像表现得像文本,因此保持相同的

级别。然后将图像上的边距设置为0以使它们粘在一起




-

Els http://locusmeus.com/

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -



Not sure - I''m guessing setting vertical-align:bottom; for "Test" will
lower the text to the level of the blocks.

If the coloured boxes are just images: don''t float anything, just go
Test <img src=".."><img src=".."><img.... ... >
This will make the images behave like text, hence remain on the same
level. Then set margins on the images to 0 to get them to stick
together.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos v?o. O resto é imperfeito.
- Renato Russo -


这篇关于内联div的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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