Basic Code for HTML

The need for the HTML is to design the front end of the website. It is very important that the attraction to any website can only be obtained with the better front end designing. In this tutorial, you will learn the basic code for HTML to build the basic website.

  • HTML document should start with doctype declaration.<!DOCTYPE html>
  • HTML document begins with <html> and ends with </html>.
  • All meta information of HTML should be written between <head> and </head>.
  • All content which is visible to the customer is return in the body of the HTML. I.e in between <body> and </body>

Doctype Declaration

  •  The doctype is used to declare the version of HTML being used in the HTML file.
  • The newest version of HTML is HTML5. 
  • Some browsers do not detect the old HTML version. If we open old HTML version code in such browsers it will show some garbage output. It will show some sign language or computer language as output.
  • It is not case sensitive.
  • Syntax
    • HTML5 (new version)- <!DOCTYPE html>
  • It was difficult to declare doctypes of older HTML versions.

Here, we discuss briefly some basic HTML topics. And later on further tutorials we have a detailed explanation on each and every topic.

HTML HEADINGS

  • There are 6 different HTML Headings, they are defined with the <h1> to <h6> tags.
  • <h1> heading is bigger in size as well as used to define the most important heading.
  • <h6> heading is smaller in size as well as used to define the least important heading.
  • The size of heading decreases from h1 to h6.

Example

HTML CODE
HTML HEADINGS
OUTPUT
Basic Code for HTML

From the above photos you can identify that different headings have different sizes and different importance levels.

HTML PARAGRAPHS

<p> This tag is used to define a HTML paragraph.

Example

HTML CODE
HTML PARAGRAPHS
OUTPUT
Basic Code for HTML

HTML LINKS

Anchor tag:

  • All HTML links are defined with the Anchor tag <a>.
  • Syntax: <a href=”https://roboticelectronics.in/”>This is a link</a>.
  • The link is specified in the href attribute. (you will learn in detail about attributes in further tutorials).

Example

HTML CODE
HTML LINKS
OUTPUT
Basic Code for HTML

HTML IMAGES

  • <img> tag is used to define HTML images.
  • Syntax: <img src=”” alt=”roboticelectronics.in” width=”104″ height=”142″> .
  • src Attribute is used to specify the source of the image.
  • alt Attribute is used to print alternate text in place of an image if the image is not loaded.
  • height Attribute is used to adjust the height of the image.
  • width Attribute is used to adjust the width of the image.

(You learn regarding these attributes in detail in future tutorials.)

Example

HTML CODE
HTML IMAGES
OUTPUT
Basic Code for HTML

In this tutorial, we have learnt the Basic code for HTML, Doctype declaration, and brief concepts of HTML elements, HTML headings, HTML paragraphs, HTML links, and HTML images. For any sort of doubts or the comments, you can reach us through the comment box. In the next tutorial, you will get to know about the

HTML Elements

HTML Attributes

HTML Headings

HTML Paragraph, that will be the add on to the basic code of HTML website.

Spread knowledge

Leave a Comment

Your email address will not be published.