问题描述
使用< fieldset>
标记有什么好处?
我没有真正得到它的用途是什么。
表单常常被分成不同的字段集。
fieldset标签允许您在逻辑上对字段集进行分组,以便您的表单更具描述性。
您还会注意到您可以
就像在真实世界中找到的表单一样。
使用fieldset设置表单的样式并显示字段间的逻辑关联。
使用字段集的优点是它们允许您以最有语义的方式标记数据(在本例中为表单)。考虑到将字段放在字段集中比将字段放在div中更具描述性。 div告诉你任何关于字段之间的关系,fieldset告诉你有一个关系。
这与许多新的HTML5标记集相似。 < footer>
例如告诉你更多关于它里面的数据的含义与不明确的< div>
。
What are the advantages of using the <fieldset>
tag?
I don't really get what it is used for.
Forms are often broken up into various sets of fields.
The fieldset tag allows you to logically group sets of fields in order that your forms be more descriptive.
You'll also note that you can use the fieldset to style your forms and display those logical associations between fields.
Just like forms you find in the "real" world.
The "advantages" of using a fieldset are that they allow you to mark up your data (in this case a form) in the most semantic way available. Consider that placing your fields in a fieldset is more descriptive than placing your fields in a div. The div tells you nothing about the relationship between the fields, a fieldset tells you there is a relationship.
It's a similar principle to many of the new HTML5 tagsets. <footer>
for example tells you more about the meaning of the data inside it compared to an ambiguous <div>
.
这篇关于使用fieldset标签的优点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!