Please support if you like my work by payment through upi: sinhamit@icici or payment by bank
account name: Amit Kumar Sinha,
account number: 2646728782
IFSC code: KKBK0005660
SWIFT: KKBKINBB
First HTML file in Category: HTML by amit
🕙 Posted on 2023-04-02 at 03:23:57 Read in Hindi ...
Basic Structure of HTML
Following image describes the CODE written in VSCode Editor. If you don't know how to create a PROJECT FOLDER and files in VSCode Editor, please visit previous page.
Explanation of HTML Code in above Image
HTML is the HyperText Markup Language. It is written in simple TEXT Editor or Code Editor, encoded in UTF-8. All letters, digits, symbols, and other characters (including emojis) are UNICODE characters, encoded in UTF-8. You can see these characters in Unicode pages.
Document Type Declaration in HTML
<!DOCTYPE html>
The first thing you should write in an HTML file, is the document declaration type. Nowadays, many browsers support modern techniques and developments of HTML5, CSS3, JavaScript 2015 (EcmaScript 6 and later updated features), PHP7 or PHP8 (updated versions), etc. But, you should be careful while writing CODES to develop your WEBSITE, because many users and hackers uses older BROWSER (when INTERNET was under-developed) and many things are recently added/updated in these languages.
Though DECLARATION TYPE in HTML5 is not important and necessary, but it will help browsers to render WEB-PAGES properly. Many professionals and developers don't use / add this first line of <!Doctype html>
declaration.
<!Doctype html> indicates that your web-page is an HTML5 document. You can use following older HTML document declaration other than <!Doctype html>
. If you don't understand what these lines are, don't worry. Even I don't grasp these things when I first saw them.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://
<!-- the above three lines are required for IE quirk mode! -->
<!-- this is XHTML1.0 doctype declaration. In XHTML, you should write HTML tags in lowercase (strict mode). Doctype declaration and xmlns
attribute are mandatory. -->
<head>
<!-- meta information should be written here. -->
<title>XHTML document</title>
<!-- <html>, <head>, <title> and <body> tags are mandatory. All tags in XHTML must be properly nested and should be in lowercase. There are other restrictions in XHTML also. -->
</head>
<body>
<!-- Contents to be displayed in WEB-Browser should be written here. -->
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//
<!-- this is HTML4.01 doctype declaration. -->
<!-- Valid way to write HTML5 declaration: -->
<!Doctype Html>
<!Doctype html><!DOCTYPE html>
<!DOCTYPE HTML>
<!doctype html>
Other HTML tags and their nesting
As you have seen above that XHTML1.0 document type declaration also requires you to follow strict instructions to NEST html tags. Now consider each pair of two tags, for example, <html></html> as a box (container) in which you can place another box. This is also known as box-modeling when you style them with CSS.
<!DOCTYPE html>
<html>
</html>
And, when <html> is paired with </html> they are collectively called, an ELEMENT. Thus, in <html></html> element, you can place <head></head> element, and <body></body> element, side-by-side. This means that both <head></head> element, and <body></body> element are siblings.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
<head></head> element is used in web-pages to:
- declare document-type,
- character-set used in the page,
- responsive design of web-page,
- script for older browsers, for example, < (less than) IE9 (internet explorer 9),
- external or embeded stylesheets and JavaScript codes,
- title, and other description of author and contents of the web-page.
Many of these information are used by Search Engine for Optimization of WEBSITE. Therefore, it is oftenly said that you should made web-pages SEO friendly.
<body></body> element is used to display contents of your WEB-PAGE. Other HTML TAGs are explained in next pages.
Leave a Comment:
Amit Sinha March 2nd, 2023 at 9:30 PM
😃 😄 😁 😆 😅 😂 😉 😊 😇 😍 😘 😚 😋 😜 😝 😶 😏 😒 😌 😔 😪 😷 😵 😎 😲 😳 😨 😰 😥 😢 😭 😱 😖 😣 😞 😓 😩 😫 😤
Ribhu March 3rd, 2023 at 9:30 PM
🐵 🐒 🐶 🐩 🐺 🐱 🐯 🐅 🐆 🐴 🐎 🐮 🐂 🐃 🐄 🐷 🐖 🐗 🐽 🐏 🐑 🐐 🐪 🐫 🐘 🐭 🐁 🐀 🐹 🐰 🐇