Notification texts go here Contact Us Click here

Working With Text IN HTML

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated


* Working with text in HTML : 

Working with text in HTML involves using various HTML elements and attributes to format and structure the content on a webpage. Here are some of the key elements and techniques for working with text in HTML:

# Basic Text Elements :

  1. Paragraphs (<p>)

    • Used to define a block of text.
    <p>This is a paragraph.</p>
  2. Headings (<h1> to <h6>)

    • Used to define headings, with <h1> being the highest level and <h6> the lowest.
    <h1>This is an H1 heading</h1> <h2>This is an H2 heading</h2>
  3. Line Breaks (<br>)

    • Used to insert a line break.
    This is the first line.<br> This is the second line.
  4. Horizontal Rules (<hr>)

    • Used to insert a horizontal line (often used to separate content).
    <hr>

# Text Formatting Elements :

  1. Bold (<b>) and Strong (<strong>)

    • <b> makes the text bold without implying any extra importance.
    • <strong> indicates that the text is of strong importance and makes it bold.
    <b>This text is bold.</b> <strong>This text is strongly emphasized.</strong>
  2. Italic (<i>) and Emphasis (<em>)

    • <i> makes the text italic without implying any extra importance.
    • <em> indicates emphasized text and makes it italic.
    <i>This text is italic.</i> <em>This text is emphasized.</em>
  3. Underlined (<u>)

    • Used to underline text.
    <u>This text is underlined.</u>
  4. Strikethrough (<s>)

    • Used to display text with a strikethrough.
    <s>This text is struck through.</s>
  5. Superscript (<sup>) and Subscript (<sub>)

    • <sup> raises the text, and <sub> lowers the text.
    H<sub>2</sub>O (Water) E = mc<sup>2</sup>

# Lists :

  1. Ordered List (<ol>)

    • Used to create a numbered list.
    <ol> <li>First item</li> <li>Second item</li> <li>Third item</li> </ol>
  2. Unordered List (<ul>)

    • Used to create a bulleted list.
    <ul> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul>
  3. Definition List (<dl>)

    • Used for a list of terms and descriptions.
    <dl> <dt>Term 1</dt> <dd>Description for term 1</dd> <dt>Term 2</dt> <dd>Description for term 2</dd> </dl>

Hyperlinks (<a>)

  • Used to create links to other pages or parts of the same page.
    <a href="https://www.example.com">Visit Example</a>

# Special Characters :

  • To display special characters, use HTML entities.
    &amp; (for &) &lt; (for <) &gt; (for >) &quot; (for ") &apos; (for ')

 # Blockquote and Cite :

    1. Blockquote (<blockquote>)

      • Used for quoting a large section of text from another source.
      <blockquote> "This is a blockquote from another source." </blockquote>
    2. Cite (<cite>)

      • Used to reference the title of a work.
      <cite>The Great Gatsby</cite>

    Text Alignment

    • Use the style attribute or CSS for text alignment.
      <p style="text-align: center;">This is centered text.</p>

    Using CSS for Advanced Styling

    For more advanced text styling, use CSS, Here’s a simple example:





  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Text Formatting Example</title>
  7. </head>
  8. <body>
  9. <h1>Text Formatting in HTML</h1>
  10. <h2>Basic Text Elements</h2>
  11. <p>This is a paragraph.</p>
  12. <p>This is another paragraph with a <br> line break.</p>
  13. <h2>Headings</h2>
  14. <h1>Heading 1</h1>
  15. <h2>Heading 2</h2>
  16. <h3>Heading 3</h3>
  17. <h4>Heading 4</h4>
  18. <h5>Heading 5</h5>
  19. <h6>Heading 6</h6>
  20. <h2>Text Formatting Elements</h2>
  21. <p><b>This text is bold.</b></p>
  22. <p><strong>This text is strongly emphasized.</strong></p>
  23. <p><i>This text is italic.</i></p>
  24. <p><em>This text is emphasized.</em></p>
  25. <p><u>This text is underlined.</u></p>
  26. <p><s>This text is struck through.</s></p>
  27. <p>Water is represented as H<sub>2</sub>O.</p>
  28. <p>Einstein's famous equation: E = mc<sup>2</sup></p>
  29. <h2>Lists</h2>
  30. <h3>Ordered List</h3>
  31. <ol>
  32. <li>First item</li>
  33. <li>Second item</li>
  34. <li>Third item</li>
  35. </ol>
  36. <h3>Unordered List</h3>
  37. <ul>
  38. <li>First item</li>
  39. <li>Second item</li>
  40. <li>Third item</li>
  41. </ul>
  42. <h3>Definition List</h3>
  43. <dl>
  44. <dt>HTML</dt>
  45. <dd>HyperText Markup Language</dd>
  46. <dt>CSS</dt>
  47. <dd>Cascading Style Sheets</dd>
  48. </dl>
  49. <h2>Hyperlinks</h2>
  50. <p>Visit <a href="https://www.example.com">Example.com</a> for more information.</p>
  51. <h2>Special Characters</h2>
  52. <p>&amp; (Ampersand)</p>
  53. <p>&lt; (Less than)</p>
  54. <p>&gt; (Greater than)</p>
  55. <p>&quot; (Double quote)</p>
  56. <p>&apos; (Single quote)</p>
  57. <h2>Blockquote and Cite</h2>
  58. <blockquote>
  59. "This is a blockquote from another source."
  60. </blockquote>
  61. <p><cite>The Great Gatsby</cite> by F. Scott Fitzgerald</p>
  62. <h2>Text Alignment</h2>
  63. <p style="text-align: center;">This text is centered.</p>
  64. <p style="text-align: right;">This text is right-aligned.</p>
  65. </body>
  66. </html>
* OUTPUT  :

Text Formatting in HTML

Basic Text Elements

This is a paragraph.

This is another paragraph with a
line break.

Headings

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Text Formatting Elements

This text is bold.

This text is strongly emphasized.

This text is italic.

This text is emphasized.

This text is underlined.

This text is struck through.

Water is represented as H2O.

Einstein's famous equation: E = mc2

Lists

Ordered List

  1. First item
  2. Second item
  3. Third item

Unordered List

  • First item
  • Second item
  • Third item

Definition List

HTML
HyperText Markup Language
CSS
Cascading Style Sheets

Hyperlinks

Visit Example.com for more information.

Special Characters

& (Ampersand)

< (Less than)

> (Greater than)

" (Double quote)

' (Single quote)

Blockquote and Cite

"This is a blockquote from another source."

The Great Gatsby by F. Scott Fitzgerald

Text Alignment

This text is centered.

This text is right-aligned.


This covers the basics of working with text in HTML. You can combine these elements and techniques to create well-structured and formatted content on your web pages.


Visit for More . . .

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.