HTML Basics-Building Blocks of Website

HTML stands for HyperText Markup Language. It is the skeleton of every website. If website is a house, HTML is its bricks and walls. Let's learn its important parts one by one.

what is Tag?

A tag is a keyword with brackets. HTML uses to tell the browser what to show. Most tags have an opening and a closing tag.

Example: <p> </p> is a paragraph tag.

What is an Element?

When you put content inside a tag, it becomes an element= Opening Tag + Content + Closing Tag.

Example: <h1>Hello Saba</h1> is a full element.

What is an Attribute?

Attribute gives extra information about a tag. It is always Written inside the opening tag.

Example: <a href="index.html"> is a link tag with href attribute.

Headings in HTML

HTML has 6 headings from h1 to h6. h1 is the biggest and most important, h6 is the smallest. We use them for titles.

Example: <h1>for main title<h2> for a sub title.

Paragraph, List and Div

p tag is for paragraphs. ul tag is for bullet list and ol for number list. div is a container to group many elements.

Example: <div><p>Text</p></div>

Link, Image and Table

a tag is for links to other pages. img tag is for showing photos. table tag with tr, th, td is for making rows and columns.

Example: <img src="photo.jpg"> and <table>