使用fieldset HTML标签对分组表单有什么意义? [英] Does the use of the fieldset HTML tag have meaning beyond grouping forms?

查看:154
本文介绍了使用fieldset HTML标签对分组表单有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我已经看到了它的形式,但是我发现将相关的数据集合起来很有帮助(例如,当您在页面上有多个表格时,使用围绕每个表格或一组相关表格的字段集来定义一个可见的含义和一个组名(图例))。这是滥用字段集标记的点,在我的用途,它不再具有语义意义?

解决方案

我可以看到语义上的优势,将内容阻塞到带有图例的字段集中。

尽管W3C将字段集和图例与表单的使用关联,允许在表单标签之外使用,实验。可能类似于正在使用的定义列表。

我个人并不认为fieldset中的字段是特定于表单字段的。它只是继承了它在表单标签中使用的关系。
字段参照分组。



想象一下,去您当地的公园和娱乐场所与您的朋友玩垒球。有3个可用字段。所有人都在围栏上有标志仅限BASEBALL



您是否收拾好装备回家?

在表单标签滥用之外标记字段集和传说的使用是有限的。



没有在定义中提及表单的地方:


FIELDSET元素允许作者
将主题相关的控件
和标签分组。分组控制使用户更容易理解其
用途,同时
便于
视觉用户代理和语音的标签导航
语音导向用户$ b的导航$ b代理商。正确使用这个元素
使得文档更易于访问。


我认为xhtml标签格式控制。 div p blockquote等。

 < h1>关于一切的大书< / h1> 
< fieldset>
< legend>笑话< / legend>
< h2> 30页幽默笑话< / h2>

Lorem ipsum dolor sit amet,consectetur adipiscing elit。< / p>
< p> Cras nec diam eu lectus condimentum faucibus in etodi。< / p>
< / fieldset>
< fieldset>
< legend> Poems< / legend>
< h2> 20页写得好的诗< / h2>

Lorem ipsum dolor sit amet,consectetur adipiscing elit。< / p>
< p> Cras nec diam eu lectus condimentum faucibus in etodi。< / p>
< / fieldset>
< fieldset>
<图例>恐怖< /图例>
< h2> 3简短和可怕的故事< / h2>

Lorem ipsum dolor sit amet,consectetur adipiscing elit。< / p>
< p> Cras nec diam eu lectus condimentum faucibus in etodi。< / p>
< / fieldset>
< fieldset>
< legend>神秘< / legend>
< h2> 3简短和神秘的故事< / h2>

Lorem ipsum dolor sit amet,consectetur adipiscing elit。< / p>
< p> Cras nec diam eu lectus condimentum faucibus in etodi。< / p>
< / fieldset>


Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fieldset tag to the point where, in my uses, it no longer has semantic meaning?

解决方案

I can see semantic advantages to blocking content into fieldsets with legends.

Although the W3C associated the use of fieldsets and legends with forms, allowing the use outside the form tag opens up new boundaries to experimentation. Potentially similar to definition list in use.

I personally do not think that the "field" in fieldset is specific to form field. It just inherited relationship from it's use within the form tag. field is in reference to the grouping.

Imagine going to your local parks and recreation to play softball with your friends. There are 3 available fields. All of them are have signs on the fence "BASEBALL ONLY"

Do you pack up your gear and go home?

labeling the use of fieldsets and legends outside the form tag abuse is narrow sighted.

No where in the definition does it mention forms:

The FIELDSET element allows authors to group thematically related controls and labels. Grouping controls makes it easier for users to understand their purpose while simultaneously facilitating tabbing navigation for visual user agents and speech navigation for speech-oriented user agents. The proper use of this element makes documents more accessible.

I consider xhtml tags formatting control. div p blockquote etc.

<h1>The Big Book about Everything</h1>
<fieldset>
    <legend>Jokes</legend>
    <h2>30 pages of humorous Jokes</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    <p>Cras nec diam eu lectus condimentum faucibus in et odio.</p>
</fieldset>
<fieldset>
    <legend>Poems</legend>
    <h2>20 pages of well written poems</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    <p>Cras nec diam eu lectus condimentum faucibus in et odio.</p>
</fieldset>
<fieldset>
    <legend>Horror</legend>
    <h2>3 Short and scary stories</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    <p>Cras nec diam eu lectus condimentum faucibus in et odio.</p>
</fieldset>
<fieldset>
    <legend>Mystery</legend>
    <h2>3 Short and mysterious stories</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    <p>Cras nec diam eu lectus condimentum faucibus in et odio.</p>
</fieldset>

这篇关于使用fieldset HTML标签对分组表单有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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