什么是“语义正确的”意思? [英] What does "semantically correct" mean?

查看:124
本文介绍了什么是“语义正确的”意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过很多在css谈。语义正确是什么意思?

I have seen it a lot in css talk. What does semantically correct mean?

推荐答案

正确标记



你称之为实际上是什么。典型的例子是,如果一个,它应该包含行和列的数据。

Labeling correctly

It means that you're calling something what it actually is. The classic example is that if something is a table, it should contain rows and columns of data. To use that for layout is semantically incorrect - you're saying "this is a table" when it's not.

另一个例子:a list

Another example: a list should generally be used to group similar items. You could use a span for each item, and style each span to be on a separate line with a bullet point, but "this is a list" conveys more information.

HTML代表超文本标记语言;其目的是标记或标记您的内容。你标记得越准确越好。

HTML stands for "HyperText Markup Language"; its purpose is to mark up, or label, your content. The more accurately you mark it up, the better. New elements are being introduced in HTML5 to more accurately label common web page parts, such as headers and footers.

所有这些语义标签帮助机器解析您的内容,这有助于用户。例如:

All of this semantic labeling helps machines parse your content, which helps users. For instance:


  • 浏览器可以正确应用您的CSS(级联样式表格),描述每种类型的内容应该看。您可以提供替代样式,或用户可以使用自己的;

  • 盲人的屏幕阅读器可以帮助他们更轻松地填写表单,只要您在语义上标记了元素,就可以使用我想要标题很大这样的规则。如果逻辑部分被分成 fieldsets 和每个图例。盲人用户可以说,哦,这部分不适用于我,所以我可以跳过,就像你通过瞥一眼。

  • 手机可以切换当他们看到类型为tel(对于电话号码)的表单输入时,他们可以使用数字键盘。

  • Browsers can correctly apply your CSS (Cascading Style Sheets), describing how each type of content should look. You can offer alternative styles, or users can use their own; as long as you've labeled your elements semantically, rules like "I want headlines to be huge" will be usable.
  • Screen readers for the blind can help them fill out a form more easily if the logical sections are broken into fieldsets with one legend for each one. The blind user can say, "oh, this section doesn't apply to me, so I can skip ahead," just as you would do by glancing at it.
  • Mobile phones can switch to a numeric keyboard when they see a form input of type "tel" (for telephone numbers).

这篇关于什么是“语义正确的”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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