Quick Contact

    HTML Text Formatting

    Introduction

    We can use HTML tags to create some text on the website pages look different from normal text. For example, users can use the tag < b> to make the text bold, tag < i> to make the text italic, tag < mark> to highlight the words, tag < code> to show a fragment of computer code, tags < ins> and < del> to mark editorial entries and deletions, and more.

    HTML has several formatting tags. Text can be bolded, italicized, or underlined with these tags. There are about 14 possibilities for how text looks in HTML and XHTML.

    The following example shows how to utilize the most widely used formatting tags. Now, let’s do this to see how these tags operate in practice:

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>Formatting Text in HTML< /title>
    < /head>
    < body>
    < p>This is bold text < b>DUCAT INDIA< /b>.< /p>
    < p>This is strongly important text < strong>DUCAT INDIA< /strong>.< /p>
    < p>This is italic text < i>DUCAT INDIA< /i>.< /p>
    < p>This is emphasized text < em>DUCAT INDIA< /em>.< /p>
    < p>This is highlighted text < mark>DUCAT INDIA< /mark>.< /p>
    < p>This is computer code < code>DUCAT INDIA< /code>.< /p>
    < p>This is smaller text < small>DUCAT INDIA< /small>.< /p>
    < p>This is subscript and superscript < sub>DUCAT< /sub> and < sup>INDIA< /sup> text.< /p>
    < p>This is deleted text < del>DUCAT INDIA< /del>.< /p>
    < p>This is inserted text < ins>DUCAT INDIA< /ins>.
    < /p>
    < /body>
    < /html>
    

    Output

    This is bold text DUCAT INDIA.

    This is strongly important text DUCAT INDIA.

    This is italic text DUCAT INDIA.

    This is emphasized text DUCAT INDIA.

    This is highlighted text DUCAT INDIA.

    This is computer code DUCAT INDIA.

    This is smaller text DUCAT INDIA.

    This is subscript and superscript DUCAT and INDIA text.

    This is deleted text DUCAT INDIA.

    This is inserted text DUCAT INDIA.

    By default, the browser renders the < strong> element as < b>, but the < em> tag is presented as < i>.

    However, there is a distinction in the meanings of these tags.

    Note:

    There are several physical and logical tags that have the same visual aspect but different in functionality.

    Difference between < strong> and < b> tag

    By default, both the < strong> and < b> tags render the contained text in a bold typeface, but the < strong> tag implies that its contents are of high importance, whilst the < b> tag just draws the reader’s attention while imparting any special significance.

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>HTML strong Vs b Tag< /title>
    < /head>
    < body>
    < p>< strong>WARNING!< /strong> Do not Swim .< /p>
    < p>The chief guest of concert is < b> Amitabh Bachan< /b>bollywood actor.< /p>
    < /body>
    < /html>
    

    Output

    WARNING! Do not Swim .

    The chief guest of concert is Amitabh Bachan bollywood actor.

    Difference between < em> and < i> tag

    Similarly, both < em> and < i> tags render the enclosed text in italic type by default, but the < em> tag indicates that its contents have stressed emphasis compared to surrounding text, whereas the < i> tag is used for marking up text that is set off from the normal text for readability reasons, such as a technical term, an idiomatic phrase from another language, a thought, etc.

    Example

    < !DOCTYPE html>
    < html lang="en">
    < head>
    < title>HTML emVsi Tag< /title>
    < /head>
    < body>
    < p>Java is < em>Object Oriented< /em> programming language.< /p>
    < p>The < i>Html stands< /i> Hyper Text markup language.< /p>
    < /body>
    < /html>
    

    Output

    Java is Object Oriented programming language.

    The Html stands Hyper Text markup language.

    Note:

    Whenever the content of your website necessitates that particular words or phrases be highlighted or highlighted, use the < em> and < strong> tags. Also, in HTML5, the < b> and I tags have been redefined; previously, they had no semantic significance.

    Formatting Quotations

    The HTML < blockquote> tag makes it simple to format quotation blocks from other sources.

    In general, blockquotes are presented with indented left and right borders, as well as a little more space above and below.

    Showing Abbreviations

    Abbreviations are shorter versions of words, phrases, or names.

    To indicate an abbreviation, use the < abbr> tag. The title property is used within this tag to provide the complete abbreviation, which is shown as a tooltip by browsers when the mouse pointer is hovered over the element.

    Marking Contact Addresses

    Street or postal addresses are frequently included on web pages. The HTML tag < address> is used to convey contact information (physical and/or digital) for a person, group of people, or organization.

    FAQS

    Q1. Can we format text in HTML?

    HTML formatting is a method of formatting text to improve its visual appeal. Various HTML elements can alter the appearance of text on a web page and make it more appealing. HTML text formatting tags can be used to bold, italicize, underline, and many other things.

    Q2. How do I show text format in HTML?

    Preformatted text is defined by the < pre> tag. Text in a < pre> element is shown in a fixed-width font, with both spaces and line breaks preserved. The content will appear precisely as it is typed in the HTML source code.

    Q3. How do you change text style in HTML?

    Use the CSS font-family attribute to alter the font type simply through HTML. Set it to the desired value and set it into a style property. Then, include this style property in an HTML element, such as a paragraph, header, button, or span tag.

    Q4. How do you color text in HTML?

    In HTML, utilize the style property to change the font colour. The style property defines an element’s inline style. The attribute is used in conjunction with the HTML < p> tag and the CSS property colour. Because HTML5 does not allow the < font> element, the CSS style is utilized to change the font colour.

    Copyright 1999- Ducat Creative, All rights reserved.

    Anda bisa mendapatkan server slot online resmi dan terpercaya tentu saja di sini. Sebagai salah satu provider yang menyediakan banyak pilihan permainan.