Home Web Front-end HTML Tutorial Simple example of HTML text formatting

Simple example of HTML text formatting

Feb 11, 2017 pm 02:18 PM
html text format

The following editor will bring you a simple example (detailed explanation) of HTML text formatting. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.

1. Text formatting: This example demonstrates how to format text in an HTML file.


##XML/HTML CodeCopy content to clipboard

  1. <html>

  2. ##<

    body>

  3. <

    b>This text is boldb>

  4. ##<
  5. br />

  6. #<
  7. strong

    >This text is strongstrong>

  8. ## <

  9. br
  10. />

  11. ##<

    big
  12. >

    This text is big##big>

    ##<
  13. br

    />
  14. <
  15. em

    >
  16. This text is emphasized
  17. < /

    em> #<

  18. br
  19. />

  20. ##<

    i
  21. >

    This text is italic

  22. i

    > <

    br
  23. />

  24. ##<small

  25. >

  26. This text is small

  27. small
  28. > ##< br

    />

  29. This text contains

    <
  30. sub

    >
  31. subscript
  32. sub
  33. >

    ##<br />

  34. ##This text contains ##<sup

  35. >

  36. superscript

  37. sup
  38. >

  39. body>

  40. ##< /

    html
  41. >

    ##The effect is as follows:

  42. 2. Preformatted text: This example demonstrates how to use the pre tag to control blank lines and spaces.


    ##XML/HTML CodeCopy content to clipboard

    1. <html>

    2. ##<

      body>

    3. <

      pre>

    4. This is
    5. Preformatted text.
    6. It preserves spaces
    7. and newlines.
    8. ##

      pre>

  43. #<
  44. p

    >pre tags are great for displaying computer code: p>

  45. ##<

  46. pre
  47. > for i

    =
  48. 1
  49. to 10

    print i

  50. next i

  51. ##

    pre
  52. >

  53. body

    > ;
  54. ##html

    >
  55. ##The effect is as follows:

3. "Computer Output" label: This example demonstrates the display effects of different "Computer Output" labels .

HTML 文本格式化的简单实例##XML/HTML Code

Copy content to clipboard


<html

>

  1. ##<body

  2. >

  3. <code

  4. >

  5. Computer code

  6. code
  7. > ##<br />

  8. <

    kbd>

Keyboard input

kbd
  • >

    <br />

  • <

    tt>

  • Teletype text

    tt
  • >

    <br />

    #<
  • samp>Sample textsamp

  • >
  • <br />

    ##<
  • var

    >

  • Computer variablevar

    >
  • <br />

  • ##<p>

  • #<

    b>

  • Note: b>These tags are often used to display computer/programming code.

    ##

    p>

  • #
  • body

    > < ;/

  • html

    >

    ##The effect is as follows:
  • 4. Address: This example demonstrates how to write an address in an HTML file.

    HTML 文本格式化的简单实例

    ##XML/HTML Code

    Copy content to clipboard

    >

    1. <

      html
    2. >

      ##<body

    3. >

    4. ##<
    5. address

      >
    6. Written by <a

      href
    7. =
    8. "mailto:webmaster@example.com"

      >Donald Ducka>.<br> Visit us at:<br

      >

    9. Example.com<br

      >

    10. ##Box 564, Disneyland<br >

    11. USA

    12. address
    13. >

    14. body
    15. >

    16. #html>

    17. The effect is as follows:

    18. 5. Abbreviations and acronyms: This example demonstrates how to implement abbreviations or initials abbreviation.

    ##XML/HTML CodeHTML 文本格式化的简单实例

    Copy content to clipboard


    <html>

    1. ##<body

      >

    2. <abbr

      title
    3. =
    4. "etcetera"

      >

    5. etc.
    6. abbr> ##<br />
    7. <acronym title="World Wide Web">WWWacronym>

    8. <p>In some browsers, title can be used to display the full version of the expression when you move the mouse over an abbreviated word . p>

    9. # #<p> is only valid for acronym elements in IE 5. p>

    10. # #<

      p>Valid for both abbr and acronym elements in Netscape 6.2. p>

    11. # #

      body> ##

    12. html

      > The effect is as follows:

    ## Six, text Orientation: This example demonstrates how to change the orientation of text.

    HTML 文本格式化的简单实例

    ##XML/HTML Code

    Copy content to clipboard

    <

    html
    1. >

      ##<
    2. body

    3. >
    4. <
    5. p

    6. >
    7. If your browser supports bi-directional override (bdo), The next line will be output from right to left (rtl);

    8. p

      >
    9. ##<
    10. bdo

      dir
    11. =
    12. "rtl "

      > Here is some Hebrew text

    13. bdo

      >
    14. ##

    15. body
    16. >

    17. html>

    18. The effect is as follows:

    19. Seven, block reference: This example demonstrates how to achieve long and short inconsistency One quote.

      HTML 文本格式化的简单实例##XML/HTML Code

      Copy content to clipboard


      <html

      >

      1. ##<body

      2. >

      3. This is a long quote:

        ##<
      4. blockquote

        >
      5. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote.

      6. ##blockquote>

      7. This is the short quote:

      8. <q>

      9. This is a short quote.

      10. ##q>

    20. #<
    21. p> If you use the blockquote element, The browser will insert line breaks and margins, and the q element will not be rendered in any special way.

    22. ##
    23. p

      >

    24. #

    25. body
    26. > < ;/

    27. html
    28. > ##The effect is as follows:

    29. Eight, delete sub-effects and insert sub-effects.

      HTML 文本格式化的简单实例

      ##XML/HTML Code

      Copy content to clipboard


      <

      html

        >

      1. ##<
      2. body

        >
      3. <
      4. p

        >
      5. There are a dozen
      6. <

        del> Twentydel> <ins>十Twoins> pieces. p> # #<

      7. p
      8. >Most browsers will rewrite this to remove text and underline text.

      9. p> # #<

        p
      10. >

        Some older browsers will display deleted and underlined text as normal text.

      11. p

        > # #body

      12. >
      13. ##html >
      14. The effect is as follows: The above HTML text format This simple example (detailed explanation) is all the content shared by the editor. I hope it can give you a reference, and I hope you will support the PHP Chinese website.

        For more articles related to simple examples of HTML text formatting, please pay attention to the PHP Chinese website!
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

    Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

    Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

    This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

    HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

    Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

    HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

    Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

    HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

    Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

    Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

    Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

    HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

    Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

    HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

    Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

    See all articles