Web Development is one of the most in-demand skills today. It involves creating user-friendly and engaging websites that can be accessed via a browser. The first step in becoming a web developer is understanding HTML.
HTML (Hyper Text Markup Language) is the backbone of any web page. It’s the standard language used to structure a webpage, determining how content is displayed in browser. While the appearance of a page is decided by CSS (Cascading Style Sheets) and its functionality by JS (Javascript), HTML is responsible for the fundamental skeleton or structure.
Before diving in this part of the course, it’s important to understand famous and recurring jargons that will be used in your journey. These will help you understand the concepts as we progress (and also make it easy for the author to explain things ;-) ).
(paragraph) inside it, the browser creates a body node with a paragraph node as its child.
) within a div tag (
HTML stands for Hyper Text Markup Language
Hyper Text: Refers to the ability of HTML to link different documents together.
Markup Language: Uses tags to annotate text, defining how it should be displayed in a browser.
Here’s the basic structure of an HTML document:
<!DOCTYPE html> <html> <head> <title>HTML Tutorial</title> </head> <body> <p>Hello, world!</p> </body> </html>
Tags: In HTML, tags are used to define elements. Tags are enclosed in angle brackets, like or
.
Elements: Consist of an opening tag and a closing tag, which may contain content. For example,
Hello, world!
is a paragraph element.Every HTML document follows a basic structure:
Here are some basic HTML elements you’ll use frequently:
To create an HTML file, you can use any text editor, such as Notepad or VS Code. Here’s a simple example:
<!DOCTYPE html> <html> <head> <title>HTML Tutorial</title> </head> <body> <h1>Example Number 1</h1> <p>Hello, world!</p> </body> </html>
You can find that there is a request in the name that you have saved as in this picture.
In the response tab, you will find the code that you have written as in the following picture
Now, what happened is that, once you opened the file you have saved as html, the computer began running the file in browser. The browser wanted something to show, so it made a request call to the file from which it was launched. The file gave the browser your code and that was found in the response section. Since it was a html file, the browser begins reading the HTML code from the top to the bottom. This process is known as parsing. During parsing, the browser encounters different HTML tags (like ,
, , etc.) and starts to build a structure called DOM based on these tags. As the browser builds the DOM, it simultaneously renders the content on your screen.Let’s take a step further by creating a simple table in HTML:
<p>Table Example</p> <table> <tr> <th>Name</th> <th>Power</th> <th>Is Kurama Present</th> </tr> <tr> <td>Naruto</td> <td>Rasengan</td> <td>Yes</td> </tr> <tr> <td>Sasuke</td> <td>Sharingan</td> <td>No</td> </tr> </table>
Notice the heading is being rendered by paragraph tag. Alternatively, you can also use
Note that