css表单元素放置,没有表格 [英] css form element placing, no tables
问题描述
你好,
我有一个网站项目,我必须设计一个没有
求助于表格的布局。我想使用表格来表格数据而不是任何
格式化布局,主要强调需要使用css来放置表格
元素。到目前为止,我的方法是使用一张桌子,原因有几个原因我不想诉诸于此,我宁愿用css放置元素并获得
$符合b $ ba标准的网站。我不确定如何做到这一点。
谢谢。
戴夫。
2004年9月16日星期四02:34:52 GMT,dave < DM ******* @ woh.rr.com>写道:
我有一个网站项目,我必须设计一个没有
求助于表格的布局。我想使用表格来表格数据而不是任何格式化布局,主要强调需要使用css来放置表单
元素。到目前为止,我的方法是使用一个表,由于几个原因我不想诉诸于此,我宁愿用css放置元素并获得符合标准的站点。我不确定如何做到这一点。
一个备受争议的问题。我的偏好,以及大约一半的
常客在这里,是考虑每个表单元素及其对应的标签实际上是表格数据:
标签和元素是有意义的,而不仅仅是装饰性的。
另一半的代表将很快告诉你如何
无论如何你都可以不用桌子来做。 ;-)
-
Stephen Poley
http://www.xs4all.nl/~sbpoley/webmatters/
2004年9月16日星期四07:56:15 +0200,Stephen Poley
< sb ****************** @ xs4all.nl> ;写道:
另一半的代表将很快告诉你,如果没有桌子你可以做到这一点。 ; - )
不,如果你这样做,我不会抱怨;)
Stephen Poley< ; SB ****************** @ xs4all.nl>在消息新闻中写道:< 4f ******************************** @ 4ax.com>。 ..另一半的代表将很快告诉你如何在没有桌子的情况下你可以做到这一点。 ; - )
我希望如此!当这个帖子
启动时,我正要问同样的问题。我知道之前已经讨论过这个问题,但我能找到的唯一可靠的解决方案就是使用一张桌子。
如果你只拿最低金额标记:
< form>
< label for =" foo">你的foo:< / label><输入id = QUOT; FOO"名称= QUOT; FOO" ...>
< label for =" bar">您的栏:< / label>< input id =" foo"名称= QUOT; FOO" ...>
< / form>
你可以设置display:block为标签,给他们一个固定的宽度
(当然是em)并将它们放在浮点数:左边或者用
位置:绝对值与
其余表格的适当保证金相结合。
问题是:Mozilla和Netscape 7(可能还有其他浏览器)
我不明白这个并且不显示标签所有:(你会
必须隐藏这些规则(如何?)或使用表格。
< academic>
我认为将标签/输入对视为
表是不合理的,但如果你不必使用它会更好更简单
那种迂回的方式。用另一种方式提出问题:
将这个标记为表实际上是按语义/逻辑添加的吗?\
< / academic>
Garmt de Vries。
Hello,
I''ve got a site project that i''ve got to design a layout without
resorting to tables. I want to use a table for tabular data not any
formatting layout, primarily emphasis needs to be on using css to place form
elements. My method thus far has been to use a table, for several reasons i
don''t want to resort to this, i''d rather place the elements with css and get
a standards compliant site. I am uncertain as to how to accomplish this.
Thanks.
Dave.
On Thu, 16 Sep 2004 02:34:52 GMT, "dave" <dm*******@woh.rr.com> wrote:
I''ve got a site project that i''ve got to design a layout without
resorting to tables. I want to use a table for tabular data not any
formatting layout, primarily emphasis needs to be on using css to place form
elements. My method thus far has been to use a table, for several reasons i
don''t want to resort to this, i''d rather place the elements with css and get
a standards compliant site. I am uncertain as to how to accomplish this.
A much discussed issue. My preference, and that of about half the
regulars here, is to consider that each form element and its
corresponding label are in fact tabular data: the association between
label and element is meaningful, not merely cosmetic.
A representative of the other half will be along shortly to tell you how
you can do it without tables anyway. ;-)
--
Stephen Poley
http://www.xs4all.nl/~sbpoley/webmatters/
On Thu, 16 Sep 2004 07:56:15 +0200, Stephen Poley
<sb******************@xs4all.nl> wrote:
A representative of the other half will be along shortly to tell you how
you can do it without tables anyway. ;-)
Nah, I won''t complain if you do ;)
Stephen Poley <sb******************@xs4all.nl> wrote in message news:<4f********************************@4ax.com>. ..A representative of the other half will be along shortly to tell you how
you can do it without tables anyway. ;-)
I do hope so! I was about to ask the same question when this thread
was started. I know the issue has been discussed before, but the only
real solution I could find was to use a table.
If you just take the minimum amount of markup:
<form>
<label for="foo">Your foo:</label><input id="foo" name="foo" ... >
<label for="bar">Your bar:</label><input id="foo" name="foo" ... >
</form>
you could set display:block for the labels, give them a fixed width
(in em of course) and position them either with float:left or with
position: absolute in combination with an appropriate margin for the
rest of the form.
The problem is: Mozilla and Netscape 7 (and possibly other browsers)
don''t understand this and don''t display the labels at all :( You''ll
have to hide these rules from them (how?) or resort to using a table.
<academic>
I think it''s not unreasonable to consider label/input pairs to be a
table, but it would be nicer and simpler if you didn''t have to use
that roundabout way. To put the question the other way: what does
marking this up as a table actually add in terms of semantics/logic?\
</academic>
Garmt de Vries.
这篇关于css表单元素放置,没有表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!