Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»html»HTML Text Formatting
    html

    HTML Text Formatting

    Editorial StaffBy Editorial StaffUpdated:April 25, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    In this blog, we will see the basic text formatting elements like center Element and <pre> Element etc.

    HTML Formatting Elements

    Formatting elements were designed to display special types of text:

    • <center> – Centring Content
    • <pre>- Text in same format
    • <b> – Bold text
    • <i> – Italic text
    • <u> – Important text
    • <sub> – Subscript text
    • <sup> – Superscript text
    • <small> – Smaller text

    The Html <center> Element:

    The Html <center> element is used for content in the center of the page or any table cell.

    Example1

    <!DOCTYPE html> 
    <html> 
    <body>
    
    <p>This is my first paragraph.</p> 
    <center>
    <p>This paragraph is in the center.</p>
    </center>
    
    </body> 
    </html>
    

    Output

    This is my first paragraph.

    This paragraph is in the center.

    The Html<pre> Element:

    To display the text in the same format as to how it is written in the HTML file, use the preformatted tag (<pre>).

    Putting any content between the starting <pre> tag and the closing </pre> tag will preserve the formatting of the source document.

    Example2

    <!DOCTYPE html>
    <html>
    <body>
    
    <h1>The <pre> Element</h1>
    
    <pre>
    Content in a pre element
    is shown in a fixed-width
    font, and it preserves
    both      text spaces, tabs and
    line breaks
    </pre>
    
    </body>
    </html>
    

    Output

    Content in a pre element
    is shown in a fixed-width
    font, and it preserves
    both      text spaces, tabs and
    line breaks
    
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    • HTML Introduction
    • HTML Editors
    • HTML Tags
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Comments
    • HTML Styles
    • HTML Text Formatting
    • HTML Colors
    • HTML links
    • HTML Images
    • HTML Styles – CSS
    • HTML Tables
    • HTML Lists
    • HTML Forms
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.