# Understanding HTML Tags and Elements

Whenever you open any webpage you see there is a use of HTML that includes diffrent tags and elements. HTML is a skeleton of webpage , before the styling and functioning we firstly build the structure of webpage then further we proceed towards the functioning and styling.

## What HTML is and why we use it

HTML stands for Hypertext Markup Language.

HTML is used to build the structure of website. It is not a programming language, it is a markup language used to structure the content on the website.

You think HTML as a skeleton of car, css as designing and styling and javascript as a engine of a car

## What an HTML Tag is

An HTML tag is keyword enclosed in angle bracket &lt; &gt; used to define elements in webpage.

For example, `<p>`,`<h1>`,`<a>` and many more….

## Opening tag , closing Tag and content

Mostly HTML tags come in pair except some tag

An opening tag show starting of something ,closing tag show ending and in between content exist.

For example

```xml
<p>This is a paragraph</p>
```

## What an HTML elements means

An HTML elements is the basic building blocks of webpage.It is a small container that tells what it is and how it behaves.

It has three parts :-

* Opening tag
    
* Closing tag
    
* Content
    

```xml
<h1>Hello World</h1>
```

`<h1>` ———&gt; opening tag

`</h1>` ———&gt; closing tag

`Hello World` ———&gt; content

## Self closing(void) elements

Self closing elements are those elements that does not have content ,so they don,t need a closing tag

For example `<hr>` , `<br>` and `<img >` they does not wrap ant content ,they just perform single task such as to break the line ,showing an image etc.

## Block level vs Inline Elements

* Block level elements are start on new line and take full width of horizontal space.
    

### Example:

```xml
<div>
<p>
<h1> to <h6>
<header>
<footer>
<ul>
<ol>
<li>
```

* Inline elements does not start on new line and take up only the space they need
    

### Example:

```xml
<span>
<a>
<img>
<strong>
<em>
<b>
<i>
<label>
```

## Commonly used HTML tags

In beginning you don’t need to learn each tags. You only need to know some commonly used tags

Some commonly used tags are:

* `<h1>` to `<h6>` heading tags
    
* `<p>` paragraph tag
    
* `<a>` links tags
    
* `<div>` grouping the content
    
* `<img>` image tag
    

## Best practice for Begginer : Inspect HTML in a browser

In the beginning of web dev journey ,you must inspect the website to see how a good developer write the HTML

Explore all the mordern website you see live HTML structure
