HTML Tutorial Extended Reading: Changing Text Appearance and Meaning
Many tags can be used to change the appearance of text and associate hidden meanings with text. Generally speaking, these tags can be divided into two categories: content-based style (content-based style) and physical style (physical style).
At the same time, the standard for Cascading Style Sheets (CSS) specified by W3C is now supported by the vast majority of browsers, providing a more comprehensive method for authors to control the appearance and layout of document text. For more information about CSS, please visit the W3school provided CSS Tutorial.
Content-based Styles
Content-based style tags inform the browser that the text it contains has specific meanings, contexts, or usages. Then the browser applies the formatting consistent with that meaning, context, or usage to the text. Note the distinction here. Content-based tags impart meaning, not formatting. Therefore, they are very important for automatic processing; computers do not care about the appearance of the document.
Since font styles are specified by semantic cues, browsers can choose an appropriate display style for users. Since styles vary from place to place, using content-based styles can help ensure that your document is meaningful to a wide range of readers. This is particularly important for browsers specifically designed for the blind and disabled, as their display options may be fundamentally different from or have very significant limitations compared to traditional text.
The current HTML and XHTML standards do not define a format for each content-based tag; they only stipulate that content-based styles must be displayed in a way different from ordinary text in the document. The standard does not even require that these content-based styles be displayed differently from each other. In practice, you may find that many of these tags have a very obvious relationship with traditional printing, with similar meanings and display styles, and are displayed in the same style and font in most browsers.
There are some rules to follow when using HTML/XHTML content-based style tags because it is very easy to simply think about how the text should be displayed without knowing what the text means. Once you start using content-based styles, the document will be more consistent and can better help with automatic search and content editing. These tags are:
Physical style
When discussing style tags based on content, we often use the word 'intention'. This is because the meaning conveyed by the tag is more important than the way the browser displays the text. However, in some cases, you may want the text to be displayed in a special way (such as italics or bold) for reasons of legality or copyright, etc. In such cases, you can use physical styles for the text.
Although the trend of other text processing systems is to precisely control style and appearance, when using HTML or XHTML, it should be avoided to use physical tags unless in very few cases. It should be as possible as to provide contextual information to the browser and use style based on content. Although browsers may not currently display these texts in italics or bold, future browsers and various document generation tools may use these content-based styles in very creative ways.
The current HTML/XHTML standard provides a total of 9 types of physical styles, including bold (bold), italic (italic), monospaced (monospaced), underlined (underlined), strikethrough (strikethrough), larger (larger), smaller (smaller), superscripted (superscripted) and subscripted (subscripted) text. These tags are:
Tip:Remember that these physical style tags have a strong effect on the adjacent text. To have full control over the display of text throughout the entire document, please use style sheets.