h2 tag in html code example Example 1: how to do h1 tag <h1> Sample Text </h1> Example 2: how to write h1 tag in html <h1>This is an h1(Heading 1) tag </h1>