HTML Notes
HTML Notes
Eg:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
OUTPUT:
My First Heading
My first paragraph.
HTML Editor:
Step 1: Open Notepad (PC)
Step 2: Write Some HTML
Step 3: Save the HTML Page
HTML Documents:
All HTML documents must start with a document type declaration: <!DOCTYPE
html>.
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>
It must only appear once, at the top of the page (before any HTML tags).
HTML Headings
HTML headings are titles or subtitles that you want to display on a webpage
<h1> defines the most important heading. <h6> defines the least important
heading:
<!DOCTYPE html>
<html>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
OUTPUT:
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
HTML Paragraphs
The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some
white space (a margin) before and after a paragraph.
HTML Links
HTML links are defined with the <a> tag:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Links</h2>
<p>HTML links are defined with the a tag:</p>
</body>
</html>
OUTPUT:
HTML Links
HTML links are defined with the a tag:
This is a link
HTML Images
HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), width, and height are provided
as attributes:
<!DOCTYPE html>
<html>
<body>
<h2>HTML Images</h2>
<p>HTML images are defined with the img tag:</p>
<img
src="https://t4.ftcdn.net/jpg/00/97/58/97/360_F_97589769_t45CqXyzjz0KXwoBZT9PRaWGHRk
5hQqQ.jpg" alt="W3Schools.com" width="104" height="142">
</body>
</html>
OUTPUT:
HTML Images
HTML images are defined with the img tag:
HTML Tables
HTML tables allow web developers to arrange data into rows and
columns.
<!DOCTYPE html>
<html>
<body>
<table border="2px">
<tr>
<th>Person 1</th>
<th>Person 2</th>
<th>Person 3</th>
</tr>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
<p>To understand the example better, we have added borders to the table.</p>
</body>
</html>
Output:
16 14 10
HTML Lists
HTML lists allow web developers to group a set of related items in lists.
The list items will be marked with bullets (small black circles) by default
<!DOCTYPE html>
<html>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Output: