How to create html first page.

Html First Page
Html First Page

1.     The <!DOCTYPE> Declaration

DOCTYPE represents document type.  It helps a web browser to load the page correctly. We need to declare only one time on the of page. We can type in upper or lower case. It uses to declare HTML version 5.

<!DOCTYPE html>

2.     How to View HTML Source

View HTML Source Code:

Right-click on the HTML page and select View Page Source.

Ctrl + U

Inspect an HTML Element:

Right-click on an element Inspect Element to see what elements are made up.

CTRL + SHIFT+ I

3.     HTML Elements

Element is that has starting and ending tag and have some content.

<tagname> some content </tagname>

Example

<body>

        <h1>Hello this is HTML 5</h1>

        <p>This is Paragraph</p>

    </body>

Some element has no content this is called an empty element. Example break line <br> element which has no ending tag.

 

4.     Nested HTML Elements

Each html document consist on nested element. Nested mean element within element. For example <!DOCTYPE html>

<html>

    <head>

        <title>HTML First Page</title>

    </head>

    <body>

        <h1>Hello this is HTML 5</h1>

        <p>This is Paragraph</p>

    </body>

</html>

In this example, you can see in the HTML element head and body elements are defined. Body and head elements also nested. The Head has a title element while the body has h1 and p element.

Html First Page Example
 Html First Page Example




5.     Empty HTML Elements

Empty HTML element has no content like break line element and hr element. These elements have no ending tag.

6.     HTML is Not Case Sensitive

Html element is not case sensitive. We can use upper or lower case. For example

<!DOCTYPE HTML>

<HTML>

    <head>

        <title>HTML First Page</title>

    </head>

    <BODY>

        <H1>Hello this is HTML 5</h1>

        <P>This is Paragraph</p>

    </BODY>

</HTML>

In this example, we use upper-and lower-case elements and it does not affect the output.



0 Comments