Re:DIV对齐问题 [英] Re: DIV Alignment problem

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

问题描述

在10/12/08 07:41 am,Daniel Kaplan写道:

On 10/12/08 07:41 am, Daniel Kaplan wrote:


制作图片类/容器并遇到一个小问题。我好像b $ b似乎无法对齐图像和/或文本。 [...]
Am making a picture class/container and running into a small problem. I
can''t seem to align the image and/or text in the frame. [...]



将文本和图像与什么对齐?

您提供的标记(无效)告诉我很少,

特别是因为示例中没有文字。测试用例的URL

会更有帮助。


-

jmm(连字符)列表(at) sohnen-moe(dot)com

(删除电子邮件的.AXSPAMGN)

Align the text and image with what?
The markup (which is invalid) you provided told me very little,
especially since there was no text in the example. An URL to a test case
would be far more helpful.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)

推荐答案

" Jim Moe" < jm *************** @ sohnen-moe.com写信息

新闻:5O ************* *****************@giganews.com ...
"Jim Moe" <jm***************@sohnen-moe.comwrote in message
news:5O******************************@giganews.com ...

于10/12/08 07:41 am ,Daniel Kaplan写道:
On 10/12/08 07:41 am, Daniel Kaplan wrote:

>我正在制作图片类/容器并遇到一个小问题。我似乎无法将图像和/或文本对齐在框架中。 [...]
>Am making a picture class/container and running into a small problem. I
can''t seem to align the image and/or text in the frame. [...]



将文本和图像与什么对齐?

Align the text and image with what?



到容器。我只是希望能够将图像放在

容器中,但我喜欢。也许在顶部,也许居中,等等。我知道我

可以绝对的方式将图像放在容器中,所以对于

个别独特的图像我可以设置它们(以及容器边框)无论我想要什么




也许我的问题应该是......是否有相对对齐

属性所以我可以轻松地将图像放在一个容器中并且有很多

品种?

To the container. I simply would like to be able to put the image in the
container however I like. Maybe at the top, maybe centered, etc. I know I
can position the image in the container in an absolute fashion, so for
individual unique images I can set them (and the container borders) wherever
I wish .

Perhaps my question should have been... Are there "relative" alignment
properties so I can place an image in a container easily and with many
varieties?


2008 -10-12,Daniel Kaplan< No **** @ NoSpam.comwrote:
On 2008-10-12, Daniel Kaplan <No****@NoSpam.comwrote:

" Jim Moe" < jm *************** @ sohnen-moe.com写信息

新闻:5O ************* *****************@giganews.com ...
"Jim Moe" <jm***************@sohnen-moe.comwrote in message
news:5O******************************@giganews.com ...

>在10/12/08 07:凌晨41点,Daniel Kaplan写道:
>On 10/12/08 07:41 am, Daniel Kaplan wrote:

>>我正在制作图片类/容器并遇到一个小问题。我似乎无法将图像和/或文本对齐在框架中。 [...]
>>Am making a picture class/container and running into a small problem. I
can''t seem to align the image and/or text in the frame. [...]


将文本和图像与什么对齐?

Align the text and image with what?



到容器。我只是希望能够将图像放在

容器中,但我喜欢。也许在顶部,也许居中,等等。我知道我

可以绝对的方式将图像放在容器中,所以对于

个别独特的图像我可以设置它们(以及容器边框)无论我想要什么




也许我的问题应该是......是否有相对对齐

属性所以我可以轻松地将图像放在一个容器中并且有很多

品种?


To the container. I simply would like to be able to put the image in the
container however I like. Maybe at the top, maybe centered, etc. I know I
can position the image in the container in an absolute fashion, so for
individual unique images I can set them (and the container borders) wherever
I wish .

Perhaps my question should have been... Are there "relative" alignment
properties so I can place an image in a container easily and with many
varieties?



是的,但它们可能不是你想要的品种......


内联元素的垂直对齐非常很难理解,确实很多奇怪的东西,并没有很多有用的东西。它甚至不是一个非常好的方法< suband< sup因为垂直

对齐方式影响线框高度。


如果你想要一个内容位于顶部,中间或

底部的盒子,你可以将盒子作为一个表格单元格,然后使用vertical-align

表格单元格(不在其中的内容)。它以一种相当直接的方式工作 - 将内容对齐到

框的顶部,中间或底部。

Yes, but they might not be the varieties you want...

Vertical-align on inline elements is very difficult to understand, does
a lot of weird things, and not very many helpful things. It''s not even a
very good way to do <suband <supbecause of the way that vertical
alignment affects line box height.

If you want a box with contents at the top, in the middle, or at the
bottom, you can make the box a table-cell and then use vertical-align on
the table-cell (not on the things inside it). That works in a fairly
intuitive way-- aligns the contents to the top, middle or bottom of the
box.



" Ben C" < sp ****** @ spam.eggswrote in message

news:sl ********************* @ bowser。 marioworld ...

"Ben C" <sp******@spam.eggswrote in message
news:sl*********************@bowser.marioworld...

内联元素的垂直对齐很难理解,是不是很多奇怪的事情,而且不是很多有用的东西。它甚至不是一个非常好的方法< suband< sup因为垂直

对齐方式影响线框高度。


如果你想要一个内容位于顶部,中间或

底部的盒子,你可以将盒子作为一个表格单元格,然后使用vertical-align

表格单元格(不在其中的内容)。它以直观的方式工作 - 将内容对齐到

框的顶部,中间或底部。
Vertical-align on inline elements is very difficult to understand, does
a lot of weird things, and not very many helpful things. It''s not even a
very good way to do <suband <supbecause of the way that vertical
alignment affects line box height.

If you want a box with contents at the top, in the middle, or at the
bottom, you can make the box a table-cell and then use vertical-align on
the table-cell (not on the things inside it). That works in a fairly
intuitive way-- aligns the contents to the top, middle or bottom of the
box.



感谢您的帮助...最终我已经足够接近我想要的了。

当然我也希望水平居中。我得到的最接近的是在一个中心容器中放置

三个容器。虽然它们是向左冲的

但它们并不是它的中心。


我猜你应该使用表吗? br />

再次感谢。,,,


Thanks for the help...eventually I got close enough to what I wanted. Of
course I wanted horizontal centering too. The closest I got was placing
three containers in one centered container. Although they were flush left
to it...they wouldn''t center within it.

Am guessing there times when you should use tables?

Thanks again.,,,


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

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