HTML Codes

HTML codes
Basic HTML Codes

Basic HTML codes

If you want to learn how to code in HTML you may have some questions in your mind. HTML stands for and what is HTML? Are the main questions about HTML that every HTML learner should know.HTML Hyper Text Markup Language and HTML is a markup language, you can learn more about HTML, CSS, JavaScript, PHP, Jquery and many more.

HTML codes

Basic HTML Codes

There are many websites and online courses which help you learn HTML codes and learn to code in HTML. W3schools and Codecademy are the most famous websites for learning HTML codes and many programming languages. Here are some most famous and commonly used HTML codes.

  1. HTML Headings

Heading tags are one of the most commonly used HTML tags. Headings are very important and crucial for you SEO (Search Engine Optimization). There are 6 heading tags in HTML, starting from h1 to h6. Learn more about HTML heading tags.

  1. HTML Paragraphs

As name suggest this tag is used to text in a paragraph form. It is used to give proper shapes to your paragraphs in a HTML page. <p></p> tag is used to wrap text in a paragraph in HTML language. Learn more about HTML paragraphs.

  1. HTML Links

Links are the most important part of the internet and HTML language. Links are used to interlink the page on the internet. <a></a> tag is used for linking pages in HTML. HTML Links allow users to click their way from one page to another. The href attribute is use to specifies the destination website address you want your link to go to. Learn more about HTML links code.

  1. Images

Images make a website or a webpage more appealing to its readers. Images are a big source of displaying information without writing too much. HTML codes for displaying images is very simple as well. Just use <img /> tag to display an image and you have to give the image path as a “src” attribute value as well. To read more about img tag click here How to Display an Image in Html5

The image tag is a single tag and empty tag, it just needs the “src” value, and it is required. The alt text attribute is important for SEO purposes.

  1. Line Break

Line breaks are very important for the reading purposes. In HTML <br> or <br /> tag is used to add a line break in a document. It is a single tag and it is an empty tag. You can use a <br> tag in a paragraph to separate text by giving a lines gap as well.

  1. Bold & Strong

There are two HTML tags <b></b> and <strong></strong> that are used to make a word or a phrase bold. These tags are paired tags it means that they must be closed with a closing tag. Both tags can be used but <strong> is used more than <b> over the internet.

  1. Italic & Emphasized

Just like bold and strong italic and emphasized tags can be used to italicize a text. Either <i></i> or <emp></emp> can be used and they are paired tags so you must end them with an ending tag. In the case of these two tags <emp> tag is used more to italicize a word or a phrase.

  1. Underline a text

Underlining word in HTML is very simple as well. Just use <u></u> tag to underline a word or a phrase in HTML language. It is a paired tag with start and end tags.

  1. Ordered Lists

There are two types of lists in HTML order lists and unordered lists. The order lists are displayed using the <ol></ol> tag and the list items are included with <li></li> tags. An ordered list begins with the <ol> tag and ach list item starts with the <li> tag. Read more about HTML ordered lists here.

  1. Unordered Lists

The unordered list is almost the same but they use <ul></ul> tags and <li></li> tags for list elements. The unordered lists don’t have numbering as they have bullets in the place of numbers. See HTML unordered lists examples code HTML unordered lists.

  1. HTML Superscript

Superscript or power of something can be shown by using the <sup></sup> HTML tags. Just wrap the text you want to be a superscript and that’s it.


Result: Word Power.

  1. HTML Subscript

Subscripts are quite similarly displayed as superscripts. You have to wrap the subscript text in <sub></sub> HTML tags. Here is an example of subscript:

Word <sub>subscript</sub>

Result: Word subscript.

  1. Horizontal Line

<hr> tag is used to draw horizontal line in a webpage. It is an empty tag and it is a single tag. Just insert <hr> tag where you want to end a section and it will draw line to separate your contents.


  1. Marked or Highlighted Text

If you want to mark or highlight a text in a webpage HTML there is a HTML code to do so. Wrap text in the <mark></mark> tags and text will be highlighted in the browser. Read more about HTML mark code.

  1. Deleted or Cross-Through or Strike Through Text

HTML has a code to display a deleted, crossed-through or strike through a text on a webpage. Wrap the text in <del></del> tags to display as a strike-through text just like this

  1. Short & Long Quotations

Block quotes are used to show a text as a block in a webpage with a different color and style just like a quote. The HTML code for block quotes is as follows:

<blockquote></blockquote> long block quotes

<q></q> for short quotes

Read more about HTML Blockquote code

  1. HTML Tables

HTML tables are used to display data in a tabular form in a webpage. HTML code for writing a HTML table is a bit tricky for a newbie. HTML tables use a few tags to display data in a tabular form. Here is the structure of HTML table code (basic):

        <td>Data Goes here</td>

It is quite confusing for a beginner but just remember that <tr></tr> tags create a table-row and <td></td> holds the table-data. There are other tags that can be used in a HTML table but they are not necessary like <tbody></tbody> and <th></th> etc.

  1. HTML div Tag

This tag is the most used tag in a HTML page. It is used wrap a area or text in part or division. As the name suggest it makes a division and further styled and modified with CSS. <div></div> tags are used to make division in HTML.

These are the HTML codes that I wanted to share with you as I use these more in my HTML pages. These can be changed and styled more attractively using CSS tricks. Please do comment about my effort that if it helped you learn to code in HTML.