HTML Tuto
As someone who started learning HTML from scratch, I understand the excitement and challenges that come with it. Here, you'll find straightforward guides and practical examples that make learning HTML enjoyable and accessible.
- So, take a moment to relax, maybe grab a cup of coffee, and enjoy the process of creating something awesome with HTML.
+ So, take a moment to relax, maybe grab a cup of coffee, and enjoy the process of creating something awesome with HTML.
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets and scripting languages such as JavaScript.
-
+
-
-
@@ -248,7 +246,7 @@
My First Heading
Components of HTML Document
-
+
<!DOCTYPEhtml >
Defines that this document is an HTML5 document.All HTML documents must start with a document type declaration.
@@ -354,14 +352,14 @@
one or more heading elements
Logo or Icon
Authorship information.
-
+
Example :
- <header >
+ <header >
<hgroup > <h2 >
- HTML examlpe page
+ HTML example page </h2 > <p >
Posted by Mayborg.
@@ -370,18 +368,18 @@
- Specifies main content in a document, the content inside the "main" element should be unique to document . It should not contain any contain any repeated content aacross document such as SideBars, Navigation Links, Copyright Info, Site Logo, and Search Forms.
+ Specifies main content in a document, the content inside the "main" element should be unique to document . It should not contain any contain any repeated content aacross document such as SideBars, Navigation Links, Copyright Info, Site Logo, and Search Forms.
Note:
- There must only be one "main" element in a document. the "main" element must not be the decendent of:
+ There must only be one "main" element in a document. the "main" element must not be the decendent of:
<article>
<aside>
@@ -446,7 +444,7 @@
-
+
@@ -466,17 +464,17 @@
Defines a search section Elements inside search can be form elements used to perform search.
Defines a search section Elements inside search can be form elements used to perform search.
Example :
- <article >
+ <article >
<h3 > Tokyo -Japan </h3 >
- <p > Tokyo , officially the Tokyo Metropolis (東京都, Tōkyō-to), is the capital of Japan and one of the most populous cities in the world, with a population of over 14 million residents as of 2023 and the second-most-populated capital in the world. </p>
+ <p > Tokyo , officially the Tokyo Metropolis (東京都, Tōkyō-to), is the capital of Japan and one of the most populous cities in the world, with a population of over 14 million residents as of 2023 and the second-most-populated capital in the world. </p>
</article >
OUTPUT :
-
+
Tokyo -Japan
Tokyo , officially the Tokyo Metropolis (東京都, Tōkyō-to), is the capital of Japan and one of the most populous cities in the world, with a population of over 14 million residents as of 2023 and the second-most-populated capital in the world.
-
-
-
+
+
+
@@ -528,33 +526,33 @@
tag defines some content aside from the content it is placed in.
The aside content should be indirectly related to the surrounding content.
-
+
Tip : The "aside" content is often placed as a sidebar in a document.
-
+
Note:
The "aside" element does not render as anything special in a browser. However, you can use CSS to style the "aside" element (see example below).
Example :
-
- <aside >
+
+ <aside >
<h3 > Osaka -Japan </h3 >
- <p > Osaka is a designated city in the Kansai region of Honshu in Japan, and one of the three major cities of Japan (Tokyo-Osaka-Nagoya). It is the capital of and most populous city in Osaka Prefecture, and the third-most populous city in Japan, following the special wards of Tokyo and Yokohama. </p>
+ <p > Osaka is a designated city in the Kansai region of Honshu in Japan, and one of the three major cities of Japan (Tokyo-Osaka-Nagoya). It is the capital of and most populous city in Osaka Prefecture, and the third-most populous city in Japan, following the special wards of Tokyo and Yokohama. </p>
The "details" tag specifies additional details that the user can open and close on demand.
@@ -574,15 +572,15 @@
The "summary" tag is used in conjunction with "details" to specify a visible heading for the details.
Example :
-
- <details >
+
+ <details >
<summary > Nashik -India </summary >
- <p > Nashik , Marathi: [naːʃik], formerly Nasik is a city in the northern region of the Indian state of Maharashtra. Situated on the banks of the river Godavari. The population of Nashik city is around 2.2 million and is emerging as one of the fastest-growing cities in India. </p>
+ <p > Nashik , Marathi: [naːʃik], formerly Nasik is a city in the northern region of the Indian state of Maharashtra. Situated on the banks of the river Godavari. The population of Nashik city is around 2.2 million and is emerging as one of the fastest-growing cities in India. </p>
</details >
OUTPUT :
-
+
Nashik -India
@@ -590,9 +588,9 @@
Nashik , Marathi: [naːʃik], formerly Nasik is a city in the northern region of the Indian state of Maharashtra. Situated on the banks of the river Godavari. The population of Nashik city is around 2.2 million and is emerging as one of the fastest-growing cities in India.
-
-
-
+
+
+
@@ -603,25 +601,25 @@
<dialog > ...</dialog>
-
+
The "dialog" tag defines a dialog box or subwindow.
The "dialog" element makes it easy to create popup dialogs and modals on a web page.
Example :
-
- <dialog open >
+
+ <dialog open >
Hello, Buddy!
</dialog >
OUTPUT :
-
+
-
+
+
@@ -632,7 +630,7 @@
-
+
Link Tags -
@@ -648,7 +646,7 @@
<a h
<a href="https://github.com/ Mayborg121" >
Visit My Github </a >
-
+
OUTPUT :
@@ -657,7 +655,7 @@
<a h
-
+
@@ -677,7 +675,7 @@
<lin
Example : <link rel="stylesheet" href="styles.css">
-
+
OUTPUT :
@@ -687,7 +685,7 @@
<lin
-
+
@@ -698,7 +696,7 @@
<nav
The <nav > tag defines a set of navigation links.
Notice that NOT all links of a document should be inside a<nav > element. The <nav > element is intended only for major blocks of navigation links.
-
+
Browsers, such as screen readers for disabled users, can use this element to determine whether to omit the initial rendering of this content.
@@ -713,7 +711,7 @@
Images are not technically inserted into a web page; images are linked to web pages. The "img" tag creates a holding space for the referenced image.
-
- Note:
- Tip:
+ Note:
+
+ Tip:
The "img" tag has two required attributes:
@@ -764,17 +762,17 @@
<img
Note:
Also, always specify the width and height of an image. If width and height are not specified, the page might flicker while the image loads. Tip: To link image to another document, simply nest the<img > tag inside an<a >tag.
-
+
Example :
-
+
<img src="img/aesthetics.jpg" alt="Cartoon picture of a boy and his dog." width="420" height="325">
-
+
OUTPUT :
-
-
-
+
+
+
@@ -788,14 +786,14 @@
<map
The "map" tag is used to define an image map. An image map is an image with clickable areas.
-
+
Note:
The required name attribute of the "map" element is associated with the <img > 's usemap attribute and creates a relationship between the image and the map.
-
+
The <map > element contains a number of <area > elements, that defines the clickable areas in the image map.
-
+
<area shape="..." coords="..." href="...">
@@ -803,40 +801,40 @@
<are
Example :
-
+
<h4>
Click on the objects in image : </h4>
<can
The "canvas" tag is used to draw graphics, on the fly, via scripting (usually JavaScript).
The "canvas" tag is transparent, and is only a container for graphics, you must use a script to actually draw the graphics.
-
+
Note:
you must use a script to actually draw the graphics.
@@ -860,18 +858,18 @@
<fig
The "figure" tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
While the content of the "figure" element is related to the main flow, its position is independent of the main flow, and if removed it should not affect the flow of the document.
-
+
<pic
The browser will look for the first<source > element where the media query matches the current viewport width, and then it will display the proper image (specified in the srcset attribute). The<img > element is required as the last child of the<picture >element, as a fallback option if none of the source tags matches.
-
+
<source media=".." srcset=".." >
@@ -951,19 +949,19 @@
<sou
Resize the browser window to load different images. </p>
The <audio > tag is used to embed sound content in a document, such as music or other audio streams.
The <audio > tag contains one or more <source > tags with different audio sources. The browser will choose the first source it supports.
-
+
The text between the <audio > and </audio > tags will only be displayed in browsers that do not support the <audio > element.
-
+
There are three supported audio formats in HTML: MP3, WAV, and OGG.
The <audio > tag is used to embed sound content in a document, such as music or other audio streams.
The <audio > tag contains one or more <source > tags with different audio sources. The browser will choose the first source it supports.
-
+
The text between the <audio > and </audio > tags will only be displayed in browsers that do not support the <audio > element.
-
+
There are three supported audio formats in HTML: MP3, WAV, and OGG.
Defines an abbrevation or an Acronym for a phrase. here only abbrevation is displayed and the abbrivated text is displayed when hovered over(similiar to tooltips).
Example :
-
- <abbr title = "Mayur Borgude" >
+
+ <abbr title = "Mayur Borgude" >
MayBorg
</abbr >
OUTPUT :
-
+
MayBorg
-
-
+
+
@@ -1141,12 +1139,12 @@
<address > ...</address >
- The "address" tag in HTML indicates the contact information of a person or an organization. The contact information can be an email address, URL, physical address, mobile number, social media, etc.
+ The "address" tag in HTML indicates the contact information of a person or an organization. The contact information can be an email address, URL, physical address, mobile number, social media, etc.
Example :
-
- <address >
+
+ <address >
Written By : <a href="mailto:
mayurborgude@gmail.com">
@@ -1160,7 +1158,7 @@
- The "b" (Bold) tag in HTML is for making text bold without adding extra importance. Text within "b" displays in a bold style.
+ The "b" (Bold) tag in HTML is for making text bold without adding extra importance. Text within "b" displays in a bold style.
Example :
-
- <b >
+
+ <b >
This Text Will Be Bold.
</b >
-
+
OUTPUT :
-
+
This Text Will Be Bold.
-
+
@@ -1207,23 +1205,23 @@
<i > ...</i >
- The "i" (italic) tag in HTML is used to display the content in italic style. This tag is generally used to display the technical term, phrase, the important word in a different language.
+ The "i" (italic) tag in HTML is used to display the content in italic style. This tag is generally used to display the technical term, phrase, the important word in a different language.
Example :
-
- <i >
+
+ <i >
This Text Will Be Bold.
</i >
-
+
OUTPUT :
-
+
This Text Will Be Italic.
-
+
@@ -1233,26 +1231,26 @@
<blockquote > ...</blockquote >
- The "blockquote" tag specifies a section that is quoted from another source.
+ The "blockquote" tag specifies a section that is quoted from another source.
" Only when I fall do I get up again. " - Vincent Van Gogh
</blockquote >
-
+
OUTPUT :
-
+
" Only when I fall do I get up again. " - Vincent Van Gogh
-
+
@@ -1272,25 +1270,25 @@
Example :
-
- <h3 >Citing Van Gogh's Art</h3 >
+
+ <h3 >Citing Van Gogh's Art</h3 >
<img src="/img/ Sunflowers_vangogh.jpg" width="200" height="200" alt="The Sunflowers">
- <p >
+ <p >
<cite>The Sunflowers</cite > by Vincent Van Gogh. </p>
-
+
OUTPUT :
-
+
Citing Van Gogh's Art
The Sunflowers by Vincent Van Gogh,1888.
-
+
@@ -1304,15 +1302,15 @@
Example :
-
+
<code > This is code </code >
-
+
OUTPUT :
-
+
This is code
@@ -1330,17 +1328,17 @@
Example :
-
+
<p > I love <del > Cats </del> <ins > Dogs</ins > ! </p >
-
+
OUTPUT :
-
+
I love Cats Dogs!
-
+
@@ -1355,26 +1353,26 @@
Example :
-
+
<p >
- <dfn title="HyperText Markup
- Language">HTML
- </dfn>
+ <dfn title="HyperText Markup
+ Language">HTML
+ </dfn>
is the standard markup language for creating web pages.
</p>
-
+
OUTPUT :
-
+
HTML
is the standard markup language
for creating web pages.
-
+
@@ -1389,27 +1387,27 @@
Example :
-
+
<p >
- <mark >
+ <mark >
HTML
- </mark >
+ </mark >
is the standard markup language for creating web pages.
</p>
-
+
OUTPUT :
-
+
HTML
is the standard markup language
for creating web pages.
-
+
@@ -1422,31 +1420,31 @@
The "meter" tag defines a scalar measurement within a known range, or a fractional value. This is also known as a gauge.
Examples: Disk usage, the relevance of a query result, etc.
-
+
Note:
The "meter" tag should not be used to indicate progress (as in a progress bar). For progress bars, use the <progress > tag.
-
+
Tip: Always add the "label" tag for best accessibility practices!
Example :
-
+
<label for="disk_c"> Disk usage C: </label > <meter id="disk_c" value="6"
- min="0" max="10">
+ min="0" max="10">
6 out of 10 </meter >
-
+
OUTPUT :
-
+
2 out of 10
@@ -1463,9 +1461,9 @@
The "progress" tag represents the completion progress of a task.
- Tip:
+ Tip:
Examples: Disk usage, the relevance of a query result, etc.
-
+
Note:
Always add the<label > tag for best accessibility practices ! Tip: Use the<progress >tag in conjunction with JavaScript to display the progress of a task.
@@ -1473,27 +1471,27 @@
Example :
-
+
<label for="file"> Download Progress : </label > <progress id="file" value="73"
- min="0" max="100">
+ min="0" max="100">
73% out of 100% </progress >
-
+
OUTPUT :
-
+
+
@@ -1509,19 +1507,19 @@
Example :
-
- <s >
+
+ <s >
this text is Striked-through.
</s >
-
+
OUTPUT :
-
+
this text is Striked-through.
-
+
@@ -1537,15 +1535,15 @@
Example :
-
- <p >
+
+ <p >
Water - H<sub >
2</sub > O
</p >
The "template" tag is used as a container to hold some HTML content hidden from the user when the page loads.
-
+
The content inside "template" can be rendered later with a JavaScript.
-
+
You can use the "template" tag if you have some HTML code you want to use over and over again, but not until you ask for it. To do this without the "template" tag, you have to create the HTML code with JavaScript to prevent the browser from rendering the code.
-
+
<script >
function showContent() {
- let temp =
- document.getElementsByTagName
- ("template")[0];
+ let temp =
+ document.getElementsByTagName
+ ("template")[0];
- let clon =
- temp.content.cloneNode(true);
+ let clon =
+ temp.content.cloneNode(true);
document.body.appendChild(clon);} </script >
-
+
OUTPUT :
-
+
@@ -1666,7 +1664,7 @@
Mountains : Pixel Art
let clon = temp.content.cloneNode(true);
document.getElementById("temp").appendChild(clon);
}
-
+
@@ -1690,28 +1688,28 @@
<li
The<menu > tag defines an unordered list of content.
Use the<menu > tag together with the <li > tag to create menu items.
-
+
Note:<menu > tag is an alternative to the<ul > tag and browsers will treat these two lists equally.
<td
The <table > tag defines an HTML table.
An HTML table consists of one<table > element and one or more<tr >,<th >, and<td > elements.
-
+
The<tr > element defines a table row, the<th > element defines a table header, and the<td > element defines a table cell.
<tfo
The<thead > tag is used to group header content in an HTML table.
The<thead > element is used in conjunction with the<tbody > and<tfoot > elements to specify each part of a table (header, body, footer).
-
+
Browsers can use these elements to enable scrolling of the table body independently of the header and footer. Also, when printing a large table that spans multiple pages, these elements can enable the table header and footer to be printed at the top and bottom of each page.
<inp
<input type="url" placeholder="Enter an URL">
-
+
OUTPUT :
-
+
Your Birth Date ?
@@ -2157,7 +2155,7 @@
<inp
-
+
@@ -2174,11 +2172,11 @@
<ifr
An inline frame is used to embed another document within the current HTML document.
-
Example :
+
Example :
<iframe src="http://www.fluffbucket.co.uk/basicweb.htm" frameborder="0">
-
+
OUTPUT :
@@ -2196,11 +2194,11 @@
<opt
The <select > element is used to create a drop-down list.
The <select > element is most often used in a form, to collect user input.
-
+
The "name" attribute is needed to reference the form data after the form is submitted (if you omit the "name" attribute, no data from the drop-down list will be submitted).
-
Example :
+
Example :
<label for="cars" >Choose a car: </label>
The <select > element is used to create a drop-down list.
The <select > element is most often used in a form, to collect user input.
-
+
The "name" attribute is needed to reference the form data after the form is submitted (if you omit the "name" attribute, no data from the drop-down list will be submitted).
-
Example :
+
Example :
<label for="review" > Write your feedback below :</label >
@@ -2254,7 +2252,7 @@
<tex
-
+
OUTPUT :
@@ -2270,17 +2268,17 @@
<tex
<datalist id=".." >...</datalist >
-
+
The <datalist > tag specifies a list of pre-defined options for an <input > element.
The <datalist > tag is used to provide an "autocomplete" feature for <input > elements. Users will see a drop-down list of pre-defined options as they input data.
-
+
The <datalist > element's id attribute must be equal to the <input > element's list attribute (this binds them together).
-
Example :
+
Example :
<form onSubmit="return false;">
@@ -2296,7 +2294,7 @@
<dat
</form>
-
+
OUTPUT :
@@ -2321,7 +2319,7 @@
<dat
<fieldset > ...</fieldset >
<legend > ...</legend >
-
+
The <fieldset > tag is used to group related elements in a form.
@@ -2329,7 +2327,7 @@
<leg
The <fieldset > tag draws a box around the related elements.
-
Example :
+
Example :
<form >
@@ -2348,7 +2346,7 @@
<leg
</form>
-
+
OUTPUT :
@@ -2375,30 +2373,30 @@
<leg
<output > ...</output >
-
+
The <output > tag is used to represent the result of a calculation (like one performed by a script).
-
Example :
+
Example :
<form oninput="x.value= parseInt(a.value)+parseInt(b.value)" >
<met
Metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, scripts, and other meta information.
-
+
The following elements can go inside the<head > element:
<title > (required)
<style >
@@ -2434,22 +2432,22 @@
<bas
The <base > tag must have either an href or a target attribute present, or both.
- There can only be one single <base > element in a document, and it must be inside the <head > element.
+ There can only be one single <base > element in a document, and it must be inside the <head > element.
-
<emb
The <embed > tag in HTML is used for embedding external applications which are generally multimedia content like audio or video into an HTML document. It is used as a container for embedding plug-ins such as Flash animations. This tag is a new tag in HTML 5, and it requires only a starting tag.
-
<obj
The <embed > tag in HTML is used for embedding external applications which are generally multimedia content like audio or video into an HTML document. It is used as a container for embedding plug-ins such as Flash animations. This tag is a new tag in HTML 5, and it requires only a starting tag.
-
<obj
Always add the<label > tag for best accessibility practices ! Tip: Use the<progress >tag in conjunction with JavaScript to display the progress of a task.
-->
-
@@ -2647,7 +2645,7 @@
-
+
id="abc"
@@ -2724,17 +2722,16 @@
<br > & <hr >
- These are not attributes but rather formatting tags<br > is used to give a line break which adds a new line character. and<hr > is used to add horizontal rule/line.
+ These are not attributes but rather formatting tags<br > is used to give a line break which adds a new line character. and<hr > is used to add horizontal rule/line.
-
+
-
What is Favicon ?
@@ -2742,38 +2739,38 @@
What is Favicon ?
-
Example :
+
Example :
<link rel="icon" type="image/x-icon" href="/img/html.ico" >
-
+
-
+
OUTPUT :
*** look at the Tab title ***
-
+
-
+
Responsive HTML | Viewport
The viewport varies with the device, and will be smaller on a mobile phone than on a computer screen.
HTML5 introduced a method to let web designers take control over the viewport, through the <meta > tag. You should include the following <meta > viewport element in all your web pages
The viewport is the user's visible area of a web page.
-
+
- XHTML or EXtensible HyperText Markup Language is a mix of HTML and XML, very similar to HTML but stricter. It’s like a rulebook for creating web pages that browsers easily understand. Unlike HTML, you have to be careful and follow the rules exactly. Most browsers support it. Just think of it as a more precise way to write web code.
-
+ XHTML or EXtensible HyperText Markup Language is a mix of HTML and XML, very similar to HTML but stricter. It’s like a rulebook for creating web pages that browsers easily understand. Unlike HTML, you have to be careful and follow the rules exactly. Most browsers support it. Just think of it as a more precise way to write web code.
+