HTTP — Hypertext Markup Language. The markup for creating webpages/documents.

Tags(angle brackets) surround the elements. Some tags close themselves(Remnant of XHTML)

DOCTYPE: Instruction to web browser what type + version of markup language(HTML) is used in the current page. It is not a tag or element. Also, it’s not case sensitive. Interpreter inside the web browser understands the markup using doctype and effectively renders the view. Various types available are HTML5, HTML4, XHTML,…

<!DOCTYPE html>   // Specifies html5

Head Tag contains metadata about that page.

<head>

<meta charset="UTF-8"> // specifies character encoding
<meta name="viewport" content="width=device-width, initial-scale=1.0"> // responsive design 
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

Semantic Elements in HTML:

Semantic elements clearly defined the objective by its name so increase the readability of the code.

Semantic Elements: header, article, footer, form, table

**Non Semantic Elements: **div, span,

According to the W3C: “A semantic Web allows data to be shared and reused across applications, enterprises, and communities.”

HTML5 introduced some new Semantic elements like headernavsection(content with header), aside(content that can be set aside), article(which give information independent info), footer.

HTML5 semantic elements also help search engines to read the page and find the required information faster. (SEO Friendly)

Some other commonly use semantic tags are figure(used with figcaption and img), time,

Different ways to add JS in HTML and when to use which one?

Two ways of adding Js in HTML:

  1. Inline JS: Put Javascript code inside the script tag and place the script tag in the head or body or after body.
  2. External JS: Put the JavaScript File location inside the script tag and place the tag at either 3 places. External scripts are practical when the same code is used on many different web pages.

Placing scripts at the bottom of the element improves the display speed because script interpretation slows down the display.

#semanticweb #html #async #html5-development #defer

HTML Basics -  Hypertext Markup Language.
2.90 GEEK