10 May 2023

What is HTML?

what is html
role of html

T
Written by

thatonevikash

What is HTML?

Did you know?

HTML is the backbone of every website you visit? It's the magic code that structures web pages and makes all the content come to life!

HTML stands for Hypertext Markup Language

Overview


Look👀!

How a most common HTML document looks like?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>
ℹ️Note


The above lines of code are commonly known as BOILERPLATE.
We can write it with the help of the emmet abbreviation- ! + enter | html5 + enter

Overview of Boilerplate

<!DOCTYPE html>
ℹ️Note


<!DOCTYPE html> tells to the browser this document is an HTML document.

<html lang="en"></html>
ℹ️Note


<html lang="en"> defining the code is written in English language.

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
</head>
📌Important


<head> contains meta-information about the HTML document itself.
<meta> metadata about the HTML document, such as character set, viewport settings, and description.
<title> Sets the title of the HTML document, which appears in the browser's title bar or tab.

<link rel="stylesheet" href="styles.css" />

<link> Links external resources like stylesheets (CSS) or icons.

<link rel="icon" href="favicon.ico" type="image/x-icon" />

<style> contains internal CSS styles for the document.

<style>
  body {
    font-family: Arial, sans-serif;
  }
</style>

<script> Includes scripts or references to external script files (JavaScript).

<script src="script.js"></script>
<body></body>
📌Important


<body> whatever we write inside it, will reflect on the browser's main screen.

ℹ️Note


<html> is the main wrapper of the html document.


Comments in HTML

<!-- Write your comment here! -->

Written with 💖 by thatonevikash!