Tips for using HTML small Tags


Phrase elements such as < EM > < / EM > can improve the document structure while retaining the expected visual style. But < small > < / small > is not very common in ordinary applications. The first impact is whether Taobao ued is negligent on this small problem?

About < small > < / small >, the results of online search are also very fragmented. Some say it is not recommended to use, and some do not mention its name in the waste label. Fortunately, this is explained in detail in the book proficient in HTML semantics, standards and styles.

Like a group of brothers such as < HR > < pre > < sup > < sub > < I > < b > < small > and < HR > < pre > < sup > < sub > < I > < b >, they are defined as representational elements. W3C says that they are elements that can simply specify font information and have no semantics. For example, < b > mark is undoubtedly replaced by < EM > or < strong >; However, it’s hard to say what’s wrong with the < I > tag when you want to use it directly when you want to represent a paragraph of foreign language in italics (the Convention of foreign language display), because when users use < span class = “” >… < / span > to represent a paragraph of italics, it takes up a lot more space than the former.

For the more complex < big > < small >, Paul haine, the author of the book, did not give a clear answer. Theoretically, they are pure representational elements, and CSS should be used to replace them. However, some influential figures in the industry (Joe Clark) suggest using them to achieve the visual effect of “weighted by importance”. The result of the discussion is that there must be gains and losses, and specific problems should be analyzed.

Back to the code of Taobao, in the < small > < / small > tag is a link to skip navigation: < a class = “invisible” href = “#content” > skip navigation and toolbar < / a >. I think that after thinking, Taobao ued adopts the same idea as the < I > tag. Instead of defining a < span class = “skipnavigation” > < / span > that takes up a lot of HTML space, it’s better to directly use < small >. More importantly, the function of skipping navigation is for users, specifically for disabled users when using a reading browser or without CSS style definition. The concise < small > < / small > may be more in line with the spirit of standardization.

The only doubt is that < small > running naked under CSS is indeed the following font size 1, which shows its original intention of non importance. But for blind users, for the reading browser, does changing < small > < / small > to < strong > < / strong > better optimize the user experience?

Recommended Today

The selector returned by ngrx store createselector performs one-step debugging of fetching logic

Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]