What is semantic markup, and why would I want to use that?

后端 未结 5 1169
心在旅途
心在旅途 2021-02-14 07:36

Like it says.

5条回答
  •  不思量自难忘°
    2021-02-14 07:49

    Using semantic markup means that the (X)HTML code you use in a page contains metadata describing its purpose -- for example, an

    that contains an employee's name might be marked class="employee-name". Originally there were some people that hoped search engines would use this information, but as the web has evolved semantic markup has been mostly used for providing hooks for CSS.

    With CSS and semantic markup, you can keep the visual design of the page separate from the markup. This results in bandwidth savings, because the design only has to be downloaded once, and easier modification of the design because it's not mixed in to the markup.


    Another point is that the elements used should have a logical relationship to the data contained within them. For example, tables should be used for tabular data,

    should be used for textual paragraphs,

      should be used for unordered lists, etc. This is in contrast to early web designs, which often used tables for everything.

提交回复
热议问题