HTML small tag usage tips

HTML small tag usage tips
Phrase elements such as <em></em> can improve document structure while retaining the intended visual style. But <small></small> is not very common in daily applications. The first impression is whether Taobao UED has neglected this small problem?

Regarding <small></small>, the results of online searches are also very fragmented. Some say that it is not recommended to use, while others do not mention its name in the abandoned tags. Fortunately, the book "Mastering HTML Semantics, Standards, and Styles" explains this in detail.

<small>, like its brothers <hr><pre><sup><sub><i><b>, is defined as a presentational element. W3C says it is an element that can simply specify font information and has no semantics. For example, the <b> tag should undoubtedly be replaced by <em> or <strong>; but as for the <i> tag, it is hard to say what is wrong with using it directly when you want to italicize a paragraph of foreign language in a page (the convention for displaying foreign languages), because when the user uses <span class="">…</span> to express a paragraph of italics, it takes up much more space than the former.

As for the more complicated <big><small>, the author of the book, Paul Haine, did not give a clear answer. In theory, they are purely presentational elements and should be replaced by CSS. But some heavyweights in the industry (Joe Clark) recommend using them to achieve a "weighted by importance" visual effect. The result of the discussion is: there are gains and losses, and specific issues must be analyzed specifically.

Back to this section of Taobao code, within the <small></small> tag is a link to skip navigation: <a class="invisible" href="#Content">Skip navigation and toolbar</a>. I think Taobao UED adopted the same idea as the <i> tag after thinking about it. Instead of defining a <span class="skipNavigation"></span> that takes up a lot of HTML space, it is better to use <small> directly. More importantly, the function of skipping navigation is for users, or more precisely, for disabled users who use reading browsers or have no CSS style definitions. The concise <small></small> may be more in line with the spirit of standardization.

The only doubt is that the <small> under the naked CSS does show its unimportant meaning in the next font size. But for blind users, for reading browsers, would changing <small></small> to <strong></strong> better optimize the user experience?

<<:  Characteristics of JavaScript arrow functions and differences from ordinary functions

>>:  How to split data in MySQL table and database

Recommend

A complete guide on how to query and delete duplicate records in MySQL

Preface This article mainly introduces the method...

How to install pyenv under Linux

Prerequisites Need to install git Installation St...

idea combines docker to realize image packaging and one-click deployment

1. Install Docker on the server yum install docke...

Detailed installation history of Ubuntu 20.04 LTS

This article records the creation of a USB boot d...

This article will show you how to use SQL CASE WHEN in detail

Table of contents Simple CASEWHEN function: This ...

Implementation of vite+vue3.0+ts+element-plus to quickly build a project

Table of contents vite function Use Environment B...

Detailed explanation of JavaScript state container Redux

Table of contents 1. Why Redux 2. Redux Data flow...

Detailed explanation of the update command for software (library) under Linux

When installing packages on an Ubuntu server, you...

Analysis of the use of the MySQL database show processlist command

In actual project development, if we have a lot o...

MySQL uses frm files and ibd files to restore table data

Table of contents Introduction to frm files and i...

WeChat applet custom scroll-view example code

Mini Program Custom Scroll-View Scroll Bar Withou...

MySQL 8.0.16 installation and configuration tutorial under CentOS7

Uninstall the old version of MySQL (skip this ste...

Detailed explanation of how to use join to optimize SQL in MySQL

0. Prepare relevant tables for the following test...

How to modify the forgotten password when installing MySQL on Mac

1. Install MySQL database on mac 1. Download MySQ...