Basic HTML Structure and Introduction towards What is HTML Tags and types of HTML Tags | Day 2


INTRODUCTION TO  HTML TAGS

  1. HTML documents are made up of a series of HTML Elements 
  2. HTML Elements tells the browser how to display the content
  3. HTML Elements are represented by Tags
  4. Browsers do not display HTML tags but use them to render the content of the page

Syntax  of  HTML  TAG :



There are 2 types of HTML Tags

                1. Paired Tags: These are the tags that have the start tag (also called as an opening tag)and 
                                          end tag (also called the closing tag).

                 2. Empty Tags / Singular Tags: These are the tags which only have  opening tag /start Tag 


Basic HTML Structure

All HTML documents should contain the following basic structure.





<!DOCTYPE  html> : Denifes the version of HTML. Tells the browser what version of HTML it is using. <!DOCTYPE  HTML> tells the browser that the document is using HTML5

<html>  </html> : This is called HTML root element (top level element) and used to wrap all the code


<html> - Marks the start of every HTML Document
                      </html> - Marks the end of every HTML Document

<html> - opening tag , opening tag has agular brackets < > and tagname in between the angular bracket i.e html. <html> -- opening tag

</html> - closing tag, closing tag has angular barkect with / as </> and tag name between the bracket as html </html> -- closing tag

<head> </head> : contains the information about the html document, It is the container for Metadata. Meta data is the data about HTML Document. Metadata typically defines the document title, character set, styles, scripts, and other meta information
These Tags describe metadata: <title>, <style>, <meta>, <link>, <script>, and <base>.

<meta charset ="utf-8">
The "meta" is info in the head. charset = character set utf-8 is character encoding capable of encoding all characters on the web. It replaced ascii as the default character encoding. Because it is the default all modern browsers will use utf-8 without being explicitly told to do so.
To display an HTML page correctly, a web browser must know the character set used in the page.
The proper way to declare your character encoding is to state it immediately after the opening head in your document, before anything else.

<title> </title>: The title element is used to define the title of the document or each web page. It defines a title in the browser tab. It also provides the title for the page when it is added to favorites. Displays title for the page in the search engine results. The title tag should typically have 50–60 characters. Google only displays the first 50-60 characters of the title tag.

<body> </body> : It is the only visible part of the html document. This part of html element contains the data in the form of links, Text or images. Predefined tags are used to structure the data written in the body.

Note: HTML tags are not case sensitive : <html> = <HTML>. But it is recommended to use lower case










Comments

Popular posts from this blog

Heading Tag

What is HTML? Basic Meaning Of Hypertext Markup Language | Day 1