Page 154 - HTML5
P. 154

Chapter 39: Text Formatting


        Introduction

        While most HTML tags are used to create elements, HTML also provides in-text formatting tags to
        apply specific text-related styles to portions of text. This topic includes examples of HTML
        text formatting such as highlighting, bolding, underlining, subscript, and stricken text.

        Syntax


              •   <abbr>Abbreviation</abbr>
              •   <b>Bold Text</b>
              •   <del>Deleted Text</del>
              •   <em>Emphasized Text</em>
              •   <i>Italic Text</i>
              •   <ins>Inserted Text</ins>
              •   <mark>Marked (or Highlighted) Text</mark>
              •   <s>Stricken Text</s>
              •   <strong>Strong Text</strong>
              •   <sub>Subscript Text</sub>
              •   <sup>Superscript Text</sup>
              •   <u>Underlined Text</u>


        Examples

        Bold, Italic, and Underline

        Bold Text


        To bold text, use the <strong> or <b> tags:

         <strong>Bold Text Here</strong>

        or


         <b>Bold Text Here</b>

        What’s the difference? Semantics. <strong> is used to indicate that the text is fundamentally or
        semantically important to the surrounding text, while <b> indicates no such importance and
        simply represents text that should be bolded.

        If you were to use <b> a text-to-speech program would not say the word(s) any differently than
        any of the other words around it - you are simply drawing attention to them without adding any
        additional importance. By using <strong>, though, the same program would want to speak those
        word(s) with a different tone of voice to convey that the text is important in some way.


        Italic Text

        To italicize text, use the <em> or <i> tags:


         <em>Italicized Text Here</em>

        or

         <i>Italicized Text Here</i>


        What’s the difference? Semantics. <em> is used to indicate that the text should have extra


        https://riptutorial.com/                                                                             138
   149   150   151   152   153   154   155   156   157   158   159