一定是更好的方式 [英] Must be a better way

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

问题描述

我想要向左浮动的图像和旁边的文字就像一张

两列表,听起来很简单吗?这就是我的结果

with


< div>

< img style =" float:left ; />< p> text< / p>

< / div>

< div style =" clear:both">< / div> ;< div>< div>


它确实有效,你可以在这里看到一个更全面的例子
http://www.hopkins81.com/views.html


但我真的需要吗?第二个div?如果没有这一切都变得凌乱但是我感觉它不必要,也许不是吗?


干杯!!!

I want images down the floating left and text just beside it like a
two column table, sounds simple right? Here is what I have come up
with

<div>
<img style="float:left; /><p>text</p>
</div>
<div style="clear:both"></div><div><div>

It does work and you can see an fuller example here
http://www.hopkins81.com/views.html

But do I really need that second div? Without it all turns messy but I
feel that its unecessary, maybe its not?

Cheers!!!

推荐答案

David写道:
我希望图像向左浮动,文本就在它旁边,就像一个两列的表,听起来很简单吧?以下是我的内容

< div>
< img style =" float:left; />< p> text< / p>
< / div>
< div style =" clear:both">< / div>< div>< div> ;

它确实有效,你可以在这里看到一个更全面的例子
http://www.hopkins81.com/views.html

但我真的需要第二个div吗?如果没有它,一切都变得凌乱,但我觉得它不必要,也许不是吗?

干杯!!!
I want images down the floating left and text just beside it like a
two column table, sounds simple right? Here is what I have come up
with

<div>
<img style="float:left; /><p>text</p>
</div>
<div style="clear:both"></div><div><div>

It does work and you can see an fuller example here
http://www.hopkins81.com/views.html

But do I really need that second div? Without it all turns messy but I
feel that its unecessary, maybe its not?

Cheers!!!




你有你的例子中不必要的最后一个DIV。倒数第二是

真的是第二组中的第一个。您的示例应该如下所示

并为每个组重复:


< div>

< img style =" ;向左飘浮; />< p> text< / p>

< / div>

< div style =" clear:both">< / div> ;


但它可以进一步改进!

所有你需要的是每个部分都重复:


< div style =" clear:left;">

< img style =" float:left;>< p> text< / p>

< / div>


在第一组中,clear:left不执行任何操作,但在每个

后续组中,它指示清除浮动。


你的< div style =" clear:both">< / div>是一个通常不需要的黑客。


-

Gus



You have an unnecessary last DIV in your example. The second-to-last is
really the first in the second group. Your example should look like this
and repeated for each group:

<div>
<img style="float:left; /><p>text</p>
</div>
<div style="clear:both"></div>

But it can be improved further!
All you need is this repeated for each section:

<div style="clear:left;">
<img style="float:left;><p>text</p>
</div>

In the first group, the clear:left does nothing, but in each
subsequent group, it instructs to clear the float.

Your <div style="clear:both"></div> is a hack which is usually not needed.

--
Gus


in comp。信息系统。 www.authoring.stylesheets ,David写道:
in comp.infosystems.www.authoring.stylesheets, David wrote:
I想要向左浮动的图像和旁边的文字就像一个两列的表,声音简单吧?以下是我的内容

< div>
< img style =" float:left; />< p> text< / p>
< / div>
< div style =" clear:both">< / div>< div>< div> ;

它确实有效,你可以在这里看到一个更全面的例子
http://www.hopkins81.com/views.html

但我真的需要第二个div吗?没有这一切都变得凌乱,但我感觉它不必要,也许不是吗?
I want images down the floating left and text just beside it like a
two column table, sounds simple right? Here is what I have come up
with

<div>
<img style="float:left; /><p>text</p>
</div>
<div style="clear:both"></div><div><div>

It does work and you can see an fuller example here
http://www.hopkins81.com/views.html

But do I really need that second div? Without it all turns messy but I
feel that its unecessary, maybe its not?




你不需要任何这些div。除非你使用严格,否则你需要第一个...... b
$ b -

Lauri Raittila< http:// www.iki.fi/lr> < http://www.iki.fi/zwak/fonts>

乌得勒支,NL。



You don''t need any of those divs. Unless you are using strict in case you
might need the first one...
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.


Lauri Raittila写道:
Lauri Raittila wrote:
www.authoring.stylesheets ,David写道:
in comp.infosystems.www.authoring.stylesheets, David wrote:
我想要向左浮动的图像和旁边的文本就像一个
两列表,听起来很简单吧?以下是我的内容

< div>
< img style =" float:left; />< p> text< / p>
< / div>
< div style =" clear:both">< / div>< div>< div> ;

它确实有效,你可以在这里看到一个更全面的例子
http://www.hopkins81.com/views.html

但我真的需要第二个div吗?如果没有它,一切都变得凌乱,但我觉得它不必要,也许不是吗?
I want images down the floating left and text just beside it like a
two column table, sounds simple right? Here is what I have come up
with

<div>
<img style="float:left; /><p>text</p>
</div>
<div style="clear:both"></div><div><div>

It does work and you can see an fuller example here
http://www.hopkins81.com/views.html

But do I really need that second div? Without it all turns messy but I
feel that its unecessary, maybe its not?



你不需要任何这些div。除非你使用严格的,否则你可能需要第一个...


You don''t need any of those divs. Unless you are using strict in case you
might need the first one...




我想告诉他,如果他是DIV是不必要的

确保在所有情况下文本都会延伸到图像下方,但他的

示例对于Firefox为800x600但不是1024x768并不适用

Opera或IE在任何地方。试试他的榜样。最好确定并使用

清除。它不会受到伤害。


-

Gus



I thought about telling him that the DIVs were not necessary if he was
sure that the text would extend below the images in all cases, but his
example was OK for Firefox at 800x600 but not at 1024x768 and not OK for
Opera or IE at any. Try his example. Better to be sure and use the
clear. It won''t hurt.

--
Gus


这篇关于一定是更好的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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