如何对齐元素并定义调整大小行为? [英] How to align elements and define resize behaviour?

查看:43
本文介绍了如何对齐元素并定义调整大小行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我是一位经验丰富的Windows程序员,但是,我非常擅长HTML技术的b $ b新手。最近我被分配了一个任务

来编写小型实用工具供我们开发内部使用

团队。我选择用HTML编写GUI并将前端设为

HTA。


虽然开发应用程序的逻辑没有问题,HTML

布局和属性需要一些额外的努力。所以,我的b $ b决定在这里问我的问题,几乎每个人都是

精通HTML并且远远超出超文本标记。

请,如果我的问题看起来过于沉闷,请耐心等待。


我的应用程序类似于向导,并具有以下布局:


+ --- + --------- +我 - 图片

|我| iframe | iframe - IFRAME对象

| | | [] - 按钮

| --- + --------- |

| [] | [] [] [] |

+ --- + --------- +


这是带元素的常规表在每个细胞内。现在

问题:


1.如何指定I-cell的宽度将自动调整为
图像宽度?目前我

硬编码WIDTH =" N"其中N是像素数。


2.如何指定第二行的高度(带

按钮)将等于按钮的默认高度?


3.在文件大小调整期间我想要:

a)第一列的宽度(带图像)不会改变

b)高度如果第二行(带按钮)不会改变

c)iframe的高度和宽度 - 细胞可以自由改变


我怎样才能实现呢?目前,在调整整个表格期间

按比例更改。


提前谢谢

Alex

Hello,

I''m experienced Windows programmer, however, I''m quite
novice in HTML technologies. Recently I was assigned a task
to write small utility for internal use in our development
team. I chose to write its GUI in HTML and make front end as
HTA.

While developing application''s logic is no problem the HTML
layout and properties require some additional efforts. So, I
decided to ask my questions here, where almost everybody is
well proficient in HTML and far beyond hypertext markup.
Please, bear with me if my questions seem too dull.

My application is wizard-like and has following layout:

+---+---------+ I - image
| I | iframe | iframe - IFRAME object
| | | [] - buttons
|---+---------|
|[] | [][] []|
+---+---------+

It''s regular table with elements inside each cell. Now the
questions:

1. How can I specify that width of I-cell will be
automatically adjusted to the width of image? Currently I
hardcoded WIDTH="N", where N is number of pixels.

2. How can I specify that height of second row (with
buttons) will be equal to the default height of button?

3. During document resize I want that:
a) width of first column (with image) won''t change
b) height if second row (with buttons) won''t change
c) height and width of iframe-cell can change freely

how can I achieve that? Currently, during resize whole table
changes proportionally.

Thanks in advance
Alex

推荐答案

Alex Blekhman写道:
Alex Blekhman wrote:
虽然开发应用程序的逻辑没有问题,HTML
布局和属性需要一些额外的努力。 />
我的应用程序类似于向导,并具有以下布局:

+ --- + --------- + I - image
|我| iframe | iframe - IFRAME对象
| | | [] - 按钮
| --- + --------- |
| [] | [] [] [] |
+ --- + --------- +

它是每个单元格内部元素的常规表。现在
问题:
While developing application''s logic is no problem the HTML
layout and properties require some additional efforts.

My application is wizard-like and has following layout:

+---+---------+ I - image
| I | iframe | iframe - IFRAME object
| | | [] - buttons
|---+---------|
|[] | [][] []|
+---+---------+

It''s regular table with elements inside each cell. Now the
questions:




停止使用表格进行布局。表格用于标记表格

数据,这显然不是。


查找CSS。位置有一些很好的布局技术

是Everything,可能适合您的需求。尝试google for

其他人,或者在CSS相关组中询问,例如ciwastylesheets

http://positioniseverything.net/

-

Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ 重新发现网页
http://GetThunderbird.com/ 回收收件箱



Stop using tables for layout. Tables are meant for marking up tabular
data, which this is clearly not.

Look up CSS. There''s some good layout techniques available at Position
is Everything, which may be suitable for your needs. Try google for
others, or ask in a CSS related group, like c.i.w.a.stylesheets

http://positioniseverything.net/

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox


" Alex Blekhman" < TK ********* @ yahoo.com>写道:
"Alex Blekhman" <tk*********@yahoo.com> wrote:
我是一位经验丰富的Windows程序员,但是,我是HTML技术的新手。


至少你并没有让通常的程序员错误地将HTML称为

编程语言,我希望你知道 ML"用HTML格式

代表标记语言。

最近我被分配了一个任务
编写小实用程序供我们开发内部使用
球队。我选择用HTML编写GUI并将前端设为HTA。

虽然开发应用程序的逻辑没有问题,HTML
布局和属性需要一些额外的努力。所以,我决定在这里提出我的问题,几乎每个人都非常精通HTML并且远远超出超文本标记。
如果我的问题看起来太沉闷,请耐心等待。

我的应用程序类似于向导


它有魔力吗?

并具有以下布局:

+ --- + --------- +我 - 图片
|我| iframe | iframe - IFRAME对象
| | | [] - 按钮
| --- + --------- |
| [] | [] [] [] |
+ --- + --------- +

它是每个单元格内部元素的常规表。


如果是网络应用程序我们会告诉你关于

语义,而不是使用表格进行布局等等。因为它是用于内联网

我会假设这个更少现在问题:

如何指定I-cell的宽度将自动调整为图像的宽度?目前我是硬编码的WIDTH =N,其中N是像素数。


然后不要这样做。表格单元格的宽度收缩包裹它周围的内容是b $ b。但是,因为您使用了魔术词应用程序我要去

假设你已经通过指定width =" 100%"来设置这个布局表以占据视口的全部宽度

在桌面上。


要使包含图像的表格单元格与图像一样宽,

但不宽,请指定宽度表格单元格在右边100%。

2.如何指定第二行的高度(带
按钮)将等于按钮的默认高度?
I''m experienced Windows programmer, however, I''m quite
novice in HTML technologies.
At least you didn''t make the usual programmer mistake to call HTML a
programming language, I live in hope that you know that the "ML" in HTML
stands for "Markup Language".
Recently I was assigned a task
to write small utility for internal use in our development
team. I chose to write its GUI in HTML and make front end as
HTA.

While developing application''s logic is no problem the HTML
layout and properties require some additional efforts. So, I
decided to ask my questions here, where almost everybody is
well proficient in HTML and far beyond hypertext markup.
Please, bear with me if my questions seem too dull.

My application is wizard-like
It does magic?
and has following layout:

+---+---------+ I - image
| I | iframe | iframe - IFRAME object
| | | [] - buttons
|---+---------|
|[] | [][] []|
+---+---------+

It''s regular table with elements inside each cell.
Had it been a web "application" we would have lectured you about
semantics, not using tables for layout etc. Since it''s for an intranet
I''m going to assume that this is less relevant.
Now the questions:

1. How can I specify that width of I-cell will be
automatically adjusted to the width of image? Currently I
hardcoded WIDTH="N", where N is number of pixels.
Then don''t do that. A table cell''s width "shrink wraps" around it''s
content. However since you used the magic word "application" I''m going
to assume that you''ve set this layout table to occupy the full width of
the viewport by specifying width="100%" on the table itself.

To get the table cell containing the image to be as wide as the image,
but no wider, specify a width on the table cell to the right to 100%.
2. How can I specify that height of second row (with
buttons) will be equal to the default height of button?




不要试图为包含按钮的行设置高度。


-

Spartanicus



Don''t try to set a height for the row containing the "buttons".

--
Spartanicus


Spartanicus< in ***** @ invalid.invalid>写道:
Spartanicus <in*****@invalid.invalid> writes:
" Alex Blekhman" < TK ********* @ yahoo.com>写道:
"Alex Blekhman" <tk*********@yahoo.com> wrote:


我的应用程序是类似向导的
My application is wizard-like



它有魔力吗?



It does magic?




虽然这句话在某些人看来可能听起来非常想要


< http://catb.org/~esr/jargon /html/W/wizard.html>


赔率在losedos环境中它意味着只需要一个与回形针交谈的界面。



While this statement may sound very wannabe in some ears

<http://catb.org/~esr/jargon/html/W/wizard.html>

the odds ar that in a losedos environment it means little more than
an interface for talking to a paperclip.

+ --- + --------- + I - image
|我| iframe | iframe - IFRAME对象
| | | [] - 按钮
| --- + --------- |
| [] | [] [] [] |
+ --- + --------- +
+---+---------+ I - image
| I | iframe | iframe - IFRAME object
| | | [] - buttons
|---+---------|
|[] | [][] []|
+---+---------+




确切的表格布局算法UA之间存在差异,而您未能提供足够的详细信息。如果您的Intranet是M



Exact table layout algorhythms differ between UAs and you fail to provide
sufficient details. If your Intranet is M


这篇关于如何对齐元素并定义调整大小行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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