📜 ⬆️ ⬇️

Ten Forgotten Tags

Tags as bricks of any document based on XML should be chosen with great pragmatism, so that later not to delete unnecessary (so-called deprecated) and not to slow down the introduction of new (sound, video). In the light of the fact that I myself am closely engaged in this topic, deciding what should be left in the WYSIWYG editor and what to add, as well as typography and semantics, then reading Nikita, I also decided to post a topic.
  1. a - few people remember why the most popular link tag uses this name and the href parameter. Even less article writers use this tag for its intended purpose, namely, as an anchor to the document section defined by the name parameter. With the transition to dynamic content using ajax, the anchor has received a new life, since the URL after # can contain the address of an open letter (see gmail), but few people notice it.
  2. address - there is no consensus whether this is a physical email address, or if this is part of the description of the document with email.
  3. abbr is a great tag for abbreviations. Using the title parameter as in the pictures, when you hover the cursor, the full title will appear.
  4. ins and del - very often blog articles and LJ change, while people write something like “upd. The question was resolved, while it is more logical to use appropriate tags for this. Of course, when an article has a history of wiki changes, the system should be more complicated.
  5. sub and sup - these tags are usually found by those who want to formulate the simplest mathematics or chemistry. But the degrees, atomic and isotopic indices are not the only function. If you have ever written a thesis, you are probably faced with the scientific design of references to sources, and footnotes using sup, along with anchor, are actively used instead of the unsupported fn tag.
  6. tfoot, thead, th, caption - all tags extending a regular table. Very often, developers complicate their lives by adding extra classes, div elements and so on.
  7. label - is used in forms as a textual description of the field and if it is linked via the for parameter
    with the element, then when pressed, activates the element. Very useful with
    checkmarks and auto-help. Recently becoming popular.
  8. fieldset and legend is the element of grouping form elements and, accordingly, the title to this group. Due to limited browsers and different displays, developers refuse to use artificial and universal div elements. But I can not mention.
  9. code, var - except for programmers. Instead, they usually use pre and em, which mine is not very semantic.
  10. base - mine is the most valuable tag for CMS, since once setting the absolute path for a document, all other objects (images, links) can be specified relatively. This reduces both the work with the templates of the programmer and reduces the code.


Be vigilant, a careless game with elements that may seem “semantically appropriate” to you can actually be either a little supported by browsers, or deprecated by the W3C in the relevant XHTML / HTML5 standard. For example menu, listing, comment, sidebar ...

Original

')

Source: https://habr.com/ru/post/26572/


All Articles