# Html course shaji

## About HTML and CSS🍕

So basically HTML is **Hypertext Markup Language.....** I know it seems boring but let's make it creative....😀

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670745343645/3gBHTe8DZ.png?auto=compress,format&format=webp align="left")

So basically, 👆 **HTML5** is the **latest** version that we use nowadays, and **CSS3** is also the latest one!

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670745477617/dMm3-8ivI.png?auto=compress,format&format=webp align="left")

So, you need to read this out and let me explain it in just one line: Basically, HTML is the **Structure** of the website and CSS is the **Presentation** of the website...

**But you don't need to worry about CSS right now😉**

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670745710505/dnS0l7xeT.png?auto=compress,format&format=webp align="left")

Now I think by seeing this image,👆 you are done about the basic things about HTML...😎

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670745824113/656w_mmav.png?auto=compress,format&format=webp align="left")

**And finally, this is 👆 something that can help you with HTML and CSS!!**

Meme on HTML and CSS 😅

Okay, let's have a small meme on HTML and CSS 👇

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670746016371/VzT-lk29B.png?auto=compress,format&format=webp align="left")

**So now I think you are completely done with HTML and CSS knowledge!! 😂**

**<mark>Now we're gonna learn about &lt;h1&gt; to &lt;h6&gt; tags and &lt;p&gt; tag</mark>**

Basic things about VS code🏈

> ***So, I am using VS code which is the easiest way to write your code!!***

**In HTML we are having a boilerplate which is the most important thing and gives a professional vibe! 😉**

So, I will start by making an HTML file called "index.html"

In VS code we're having a special thing for having a boilerplate if we just hit `!` then we'll be having our boilerplate ready!! 😎

```xml
!
```

Result 👇

```xml
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
</html>
```

And BOOM💥!

*<mark>Our Boiler Plate is ready!!</mark>*

## Basic Syntax of HTML🏉

In HTML we will be writing our code in the `<body>` tag!

So let's begin!!

To have a `Heading` on our website we use the `<h1>` tag... Now you might wonder what is `<h1>` tag is.

It's just `heading 1`

**Let me show you an example of it:**

```xml
<h1>Practice makes Perfect</h1>
```

Output:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670747794447/bwuCMsFUp.png?auto=compress,format&format=webp align="left")

BOOM💥

**And make sure you need to write this code in your** `<body> tag`.

## Images in HTML 🥪

So, for **putting images** on our website we need the `<img>` tag which does not have a **closing tag** like `<h1>`.

So, let me show you the syntax of the `<img>` tag!

* Take an image via google and **copy the image link.**
    

Like I have taken of **Pizza**

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670749488099/wgVAPwqiL.png?auto=compress,format&format=webp align="left")

**And let's come to the point that how to upload the image...**

And we are having the `source` attribute and the short we'll use is `scr=""`.

```xml
<img src="https://media.istockphoto.com/id/938742222/photo/cheesy-pepperoni-pizza.jpg?s=612x612&w=0&k=20&c=D1z4xPCs-qQIZyUqRcHrnsJSJy_YbUD9udOrXpilNpI=">
```

In the `scr=""` the attribute we need to paste the image link and we will be having on our site!! 😉

**Hope you understand about images!**

*LET'S MAKE IT MORE CREATIVE BY ADDING HEADINGS AND PARAGRAPHS!*

```xml
<h1>Let's eat Pizza!🍕🍕🍕</h1>
<h3>From La'Pinoz pizza</h3>
<p>We'll eat the margherita pizza with some toppings and extra cheese!</p>
<img src="https://media.istockphoto.com/id/938742222/photo/cheesy-pepperoni-pizza.jpg?s=612x612&w=0&k=20&c=D1z4xPCs-qQIZyUqRcHrnsJSJy_YbUD9udOrXpilNpI=" width="90%">
```

Output:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670756879455/4snRPAn2f.png?auto=compress,format&format=webp align="left")

**Here I have added a width attribute too.**

## Nesting🧵

So now, it's time to learn about Nesting which is the last thing in Part 2!!

Like if we want to group all of the HTML elements!

For that, we would use `<div>` tag which is the `divider` but I don't like this name so we can tell this is a container!!

Let me show you by example!!

```xml
<div>
    <h1>Let's eat Pizza!🍕🍕🍕</h1>
    <h3>From La'Pinoz pizza</h3>
    <p>We'll eat the margherita pizza with some topings and extra cheese!</p>
        <div>
            <img src="https://media.istockphoto.com/id/938742222/photo/cheesy-pepperoni-pizza.jpg?s=612x612&w=0&k=20&c=D1z4xPCs-qQIZyUqRcHrnsJSJy_YbUD9udOrXpilNpI=" width="90%">
        </div>
</div>
```

Here I have wrapped all of the HTML in a `<div>` tag and also I have wrapped the `<img>` tag for readability purposes!!

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670840043620/YukgQ-m2O.png?auto=compress,format&format=webp align="left")

This is an example from scrimba and this will make it easy for you!

## **Basic Tags in HTML ✨**

### &lt;br&gt; tag ❤️‍🔥

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677063939756/a886a29f-0414-40b5-b12f-d346b62444b5.png?auto=compress,format&format=webp align="left")

```xml
<h1>We are Learning br tag</h1>
<br />
<p>I am Amena</p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064148358/70e498ad-1288-4b1c-ac65-9ec7cc58040d.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! ❤️‍🔥**

### &lt;b&gt; tag! 🚀

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064264497/fe4e795f-276e-4311-aeaf-55757d6121e0.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <b>Code Arena</b></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064323853/5799206f-585b-4b16-b7dc-17563bb77844.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 🚀**

### &lt;i&gt; tag! 💎

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064365663/f2c7aa96-0c88-4e97-82b6-40a0a95cb516.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <i>Code Arena</i></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064432299/5433d349-efa8-4e6e-8d12-892e44cb4203.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 💎**

### &lt;u&gt; tag! 🎯

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064490474/4436a556-58d9-4310-9db8-7149a6577519.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <u>Code Arena</u></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064520319/cc30e8cf-765b-43cc-8aa9-7db54ac9f989.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 🎯**

### &lt;big&gt; tag! 🎡

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064641065/95f4a31c-a66b-4138-b1a1-1488de63e475.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <big>Code Arena</big></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064677561/ae72c1d6-11be-4254-911e-34b6bd54cedf.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 🎡**

### &lt;small&gt; tag! 👻

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064728735/d650a02e-eea1-4962-ba25-f8dbc8233f9d.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <small>Code Arena</small></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064757827/895b7334-ae7a-4399-9825-809efbe9e9fb.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 👻**

### &lt;hr&gt; tag! 💚

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064810919/1faffae1-6789-40fd-9f7c-218a1f7c303f.png?auto=compress,format&format=webp align="left")

```xml
<p>My YouTube Channel's name is <b>Code Arena</b></p>
<p>My YouTube Channel's name is <i>Code Arena</i></p>
<p>My YouTube Channel's name is <u>Code Arena</u></p>
<p>My YouTube Channel's name is <big>Code Arena</big></p>
<p>My YouTube Channel's name is <small>Code Arena</small></p>
<hr />
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064897395/fc3fb5ef-e244-427a-9c5c-2fffc439ff12.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 💚**

### &lt;sub&gt; tag! 🎃

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064951981/7b661cf7-4009-4f28-91d6-a012ce677529.png?auto=compress,format&format=webp align="left")

```xml
<p>O<sub>2</sub></p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677064978157/3631cf78-fdfe-4b75-a38f-831c0eaf0f0a.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 🎃**

### &lt;sup&gt; tag! 🏏

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677065028906/ae695f6c-360f-48a3-afaf-9899b0bc5665.png?auto=compress,format&format=webp align="left")

```xml
<p>5<sup>2</sup> = 25</p>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677065052873/07a522c6-d194-4800-87ac-579accc51c49.png?auto=compress,format&format=webp align="left")

**Hopefully, you're cleared with it! 🏏**

### &lt;nav&gt; tag! ✨

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677065107273/0ba7568a-5594-4aa1-a143-6c597b82c40d.png?auto=compress,format&format=webp align="left")

What is a nav tag? It's just like a &lt;div&gt; tag but with a different name!

In the eg. shown above, when we see such options above our screen this is a nav tag, We can div tag also but **recommended is a nav tag**! 🔥

## **Anchor Tags (LINKS in HTML)**

Okay, now we'll talk about "&lt;a&gt;" tags means Anchor tags are LINKS!

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672737619018/b322b3c9-1e8b-4b24-83e3-fee14b90b074.png?auto=compress,format&format=webp align="left")

**Example:**

```xml
<a href="https://www.youtube.com">Click here</a>
```

* So, here we have created an **"Anchor Tag"** and in it, I have written **"href"** which is used to connect the links and I have linked it to YouTube!!
    
* Let me show the OUTPUT...
    

**OUTPUT of this code: 👇**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672738104014/7e30e056-0fea-4264-81c4-10e906a9a2ba.png?auto=compress,format&format=webp align="left")

If we click here then we'll be on YouTube isn't it amazing! 😍

**<mark>Let's do something fun:</mark>**

```xml
    <h2>I want to eat PIZZA let me find the Recipe! 😉</h2>

    <h3>Let's search in YouTube!! 🙌</h3>
    <a href="https://www.youtube.com">Click here</a>
```

**OUTPUT:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672738373099/cc5ef8fd-fd1c-4192-b222-0341dbf46f57.png?auto=compress,format&format=webp align="left")

Hopefully, you understood the concept of <mark>creating links</mark>!

*I want you to write these things and understand!*

### Open the link in the new tab

```xml
    <a href="https://www.youtube.com" target="_blank">Click here</a>
```

> ***If you want to open this link in the new tab you can use "target\_blank"***
> 
> ***I know it's weird but it is what it is...***

## Proper Structure in HTML

As you all know nowadays we use <mark>HTML5</mark> which is the latest version of HTML.

So, the proper structure will be:

```xml
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
</html>
```

> ***If you use VS code so you can just hit "!" then you will see this whole thing because professionals do like this...***

## Lists In HTML

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675339286646/119e9b50-dbb3-4c13-8ab2-334163569be6.png?auto=compress,format&format=webp align="left")

**So, there are two types of lists: 1. ordered list & 2. unordered list.**

The short for <mark>the ordered list </mark> is: ***&lt;ol&gt; tag***

The short for <mark>the unordered list</mark> is: ***&lt;ul&gt; tag***

Inside these lists, there are <mark>LIST ITEMS:</mark> ***&lt;li&gt; tag***

### Ordered Lists

```xml
    <!-- Ordered List -->
    <ol>
        <li>Ludo</li>
        <li>Chess</li>
        <li>Monopoly</li>
        <li>Game of Life</li>
    </ol>
```

**Output: 👇**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675340798632/884686b5-44e2-4240-bf99-bf33438eeb6a.png?auto=compress,format&format=webp align="left")

* The code I have written is so ***simple*** *and* ***normal***\*...\*
    

Basically, In the Ordered list, there is a condition and in that condition, it automatically provides the numbers like **1.....**.**2.....3.....so on!**

### Unordered Lists

```xml
    <!-- Unordered List -->
    <ul>
        <li>Ludo</li>
        <li>Chess</li>
        <li>Monopoly</li>
        <li>Game of Life</li>
    </ul>
```

In this code, there is the condition that if we write an **<mark>Unordered list </mark>** It will Output like this! 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1675341002495/2abb3171-68ee-4f65-9bb2-9ed9583c86c6.png?auto=compress,format&format=webp align="left")

**Hopefully, You understood Lists in HTML...**

## HTML &lt;input&gt; Tag

The `<input>` element is an HTML tag that is used to create various types of form controls on a web page.

Different input types:

[https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input\_types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types)

```xml
   <form action="">
        <label for="firstname">First Name</label>
        <input type="text" name="firstname" id="firstname" placeholder="first name" required>
        <label for="lastname">Last Name</label>
        <input type="text" name="lastname" id="lastname" placeholder="last name" required>
        <input type="email" required>
        <input type="color">
        <button>Submit</button>
    </form>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681579535678/56b3d716-4cd0-41f1-a3ab-f5763ba39f41.png align="center")

**Input tag types!**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672496000491/fe54a5c8-75b4-4a98-ba3d-87340e291df7.png?auto=compress,format&format=webp align="left")

### &lt;input type="range"&gt;

%[https://codepen.io/shajahanshaik/pen/zYmqWax] 

### &lt;input type="radio"&gt;

%[https://codepen.io/shajahanshaik/pen/rNqedrB] 

**name should be same for every input element otherwise two options can be selected.**

## **Form element:**

The &lt;form&gt; element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc.  The purpose of a form is to collect data from users, such as their name, email address, and other information

The most common attributes of the **&lt;form&gt;** element are:

* **action**: specifies the URL of the script or program that will process the form data when it is submitted.
    
* **method**: specifies the HTTP method to be used when submitting the form data, which is usually either "get" or "post".
    
* **name**: specifies a name for the form, which can be used to identify it in JavaScript code or on the server.
    

```xml
<form action="" method="get" class="form-example">
  <div class="form-example">
    <label for="name">Enter your name: </label>
    <input type="text" name="name" id="name" required>
  </div>
  <div class="form-example">
    <label for="email">Enter your email: </label>
    <input type="email" name="email" id="email" required>
  </div>
  <div class="form-example">
    <input type="submit" value="Subscribe!">
  </div>
</form>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681579655724/bf3bd6d7-3958-4f1d-8e5d-ffcba11b1e97.png align="center")

## **Button:**

In HTML, the `<button>` element is used to create a clickable button that can trigger an action or event on a web page.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670844402210/GE3ckbYJo.png?auto=compress,format&format=webp align="left")

Buttons are required on any website, like buying any product there is a specific button there. And we'll learn that only!

```xml
<button>Buy</button>
```

**Output**:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1670844805865/3NfwnJvGJ.png?auto=compress,format&format=webp align="left")

**Boom💥**

## placeholder Attribute

The `placeholder` attribute specifies a short hint that describes the expected value of an input field

```xml
<label for="email">Email:</label>

<input type="email" id="email" name="email" placeholder="Enter your email address">
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681580198252/792fb9a0-8523-453c-be04-4e7a3fc3be6f.png align="center")

## &lt;label&gt;: The Label element

The `<label>` [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) element represents a caption for an item in a user interface.

```xml
<form action="">
        <label for="firstname">First Name</label>
        <input type="text" name="firstname" id="firstname" placeholder="first name">
        <label for="lastname">Last Name</label>
        <input type="text" name="lastname" id="lastname" placeholder="last name">
        <button>Submit</button>
    </form>
```

**Output:**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681580327297/03a70220-b4b6-428d-a7b7-5c66408439ad.png align="center")

## **Textarea**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681580376691/631b1939-01ef-49aa-acd1-ae0634cb5b2e.png align="center")

```xml
<label for="story">Tell us your story:</label>

<textarea id="story" name="story"
          rows="5" cols="33">
It was a dark and stormy night...
</textarea>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681580433465/4e2a04c8-c2c0-4fb5-9b3a-750a50732d1e.png align="center")

## **Checkbox**

```xml
<div>
      <input type="checkbox" id="scales" name="scales" checked>
      <label for="scales">Scales</label>
    </div>

    <div>
      <input type="checkbox" id="horns" name="horns">
      <label for="horns">Horns</label>
    </div>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681580505603/e2db18f5-6e26-4b3d-8f1d-e6277ada8d4a.png align="center")

## HTML &lt;select&gt; tag

HTML &lt;select&gt; tag is used to create a drop down list with multiple options. The &lt;option&gt; element is nested within &lt;select&gt; tag for defining options in a list.

%[https://codepen.io/shajahanshaik/pen/poxyLOY] 

**Value is sent to data and text is shown to outside**

## &lt;span&gt;: The Content Span element

the `<span>` element is an inline-level HTML tag that is used to group and apply styles to inline elements without affecting the overall structure of the document.

%[https://codepen.io/shajahanshaik/pen/ZEqWoGG] 

## &lt;div&gt;: The Content Division element

the `<div>` element is a container element that is used to group together other HTML elements and apply styles to them.

```xml
<div>
  <h1>Welcome to our website</h1>
  <p>Our company provides top-quality products and services to customers worldwide.</p>
</div>
```

## Tables

open this: [https://www.w3schools.com/html/html\_tables.asp](https://www.w3schools.com/html/html_tables.asp)

```html
<body>
    <h1>Tables</h1>
    <table>
        <thead>
            <tr>
                <th>Item</th>
                <th>Price</th>
                <th>Quantity</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Hot Chocolate</td>
                <td>$2.40</td>
                <td>2</td>
            </tr>
            <tr>
                <td>Coffee</td>
                <td>$1.50</td>
                <td>1</td>
            </tr>
            <tr>
                <td>Cookies</td>
                <td>$3</td>
                <td>5</td>
            </tr>
        </tbody>
    </table>

</body>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1681584157090/4ee7cfa3-e4e4-4652-bfe1-6d21c2e12bf3.png align="center")
