All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

Text Formatting Tags In HTML With Example

Last Updated : Mar 11, 2024

Text Formatting Tags In HTML With Example

In this tutorial we will show you text formatting tags in HTML with example, in HTML there are many ways with the help of which you are able to format text.

One of the easiest method is with the help of CSS, it matters not that CSS used is inline, internal and external.

You can use any CSS to apply formatting styles.

But there is also one inbuilt feature of html, that it has its inbuilt tags for formatting of text in html, here we also show you some example. We hope that you understand them properly.

Step By Step Guide On Text Formatting Tags In HTML With Example :-

Now, here below we show you an html code. In which we just use html formatting tags in body part of html code.

Here, we used different tags and the explanation of tags in already typed inside them.

But if you don’t understand them you must open this code on browser and see what the effect of that tags on the text is.

This is the best way to understand html codes. And after this you can customize the code according to yourself.

Let us understand this with the example of html codes.

<!DOCTYPE html>
<html>
<head>
    <title>forms</title>
<style>
    body{
        font-size: 25px;
        text-align: center;
    }
</style>
<body>
    <b>
        this tag is used to make text bold
    </b>
    <br> <br>
    <strong>
        this tag is used to make text important
    </strong>
    <br> <br>
    <i>
        this tag is used to make text italic
    </i>
    <br> <br>
    <em>
        this tag is used to make text emphasized
    </em>
    <br> <br>
    <mark>
        this tag is used to make text marked
    </mark>
    <br> <br>
    <small>
        this tag is used to make text small
    </small>
    <br> <br>
    <del>
        this tag is used to make text delete
    </del>
    <br> <br>
    <ins>
        this tag is used to make text inserted
    </ins>
    <br> <br>
    this tag is used to make text subscripted like
    <sub>
        subscripted text here
    </sub>
    <br> <br>
    <sup>
        superscripted text here
    </sup>
    this tag is used to make text superscripted like
</body>
</html>
  1. First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
  2. Secondly, the <html> tag is used to indicate the beginning of an HTML document.
  3. As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
  4. Here, the content to be showed on browser’s display is written here. Here, we show you two example mostly both are same. Here, we create different tags and that all are paired tag.
  5. B tag is used to make text bold
  6. Strong tag is used to make text strong or important
  7. I tag is used to make text italic
  8. Em tag is used to make text emphasized
  9. Mark tag is used to mark text, you can see marked text by opening this code in browser.
  10. Small tag is used to make text small and decrease font size
  11. Del tag is used to make text delete, you can also see example by running code.
  12. Ins tag is used to make text inserted
  13. Sub tag is used to make text subscript and used as inline tag
  14. Sup tag is used to make text superscripted, this tag is also inline tag and you can see result on browser.
  15. At last, the <body> and <html> tags are closed with </body> and </html> respectively.

Conclusion :-

In conclusion, here we want to say that there are many ways to use formatting tag.

Here is an assignment for you to write a 50 words line which is unbreakable and all above tags must be used in that line.

I hope this tutroial on text formatting tags in HTML with example helps you.

Author Image About Riya

A recent graduate with a Bachelor of Technology (B.Tech) in Computer Science from India. She is passionate about leveraging technology to solve real-world problems. With a strong foundation and experience in programming languages such as Python, Django, HTML, CSS, and JavaScript, java, php and have honed her skills through hands-on projects and coursework.

Follow Riya On Linkedin 🡪