HTML Language Web Programming

How to Create Web Page Using HTML

html webpage

You should know that an HTML file is a text file saved with a.html or.htm extension to learn how to build a Html web page.

In this tutorial, you will learn how to create an HTML a web page or document. To start coding HTML you need only two stuff: a simple-text editor and a web browser, we will start creating an HTML page.

HTML Basics

  • <!DOCTYPE html> is the document type declaration. It instructs the browser that this document is an HTML5 document. A DOCTYPE declaration appears at the top of a web page before all other elements; however, the doctype declaration itself isn’t an HTML tag. Every HTML document requires a document type declaration to ensure that pages are displayed correctly.
  • The <head> element is a container for the tags that provides information about the document, for example, <title> tag defines the title of the document.
  • The <body> element contains the actual content of the document (paragraphs, images, links, tables, and so on) that is rendered in the web browser and displayed to the user.
  • The <html><head>, and <body> tags are the basic skeleton of every web page. Content inside the <head> and </head> are invisible to users with one exception: the text between <title> and </title> tags which appear as the title on a web browser tab.

You will learn more about the various HTML components in other articles here in Bibloteka. In this article, we focus on the basic structure of the HTML document.

HTML Tags and Elements

HTML is written in the form of markup tags consisting of HTML elements. These markup tags are the primary characteristic of HTML. Every markup tag is composed of a keyword, surrounded by angle brackets, such as <html><head><body><title><p>, and so on.

HTML tags normally come in pairs like <html> and </html>. The first tag in a pair is called the opening tag, and the second tag is always called the closing tag.

Opening tag & closing tag are similar, except a slash (/) after the opening angle bracket of the end tag, to tell the browser that the command has been completed.

In between the start and end tags you can place suitable contents. Like, a paragraph, which is represented by the p the element would be written as:

<p>This code is for a paragraph.</p>
<!– Paragraph with nested element –>
<p>
This is <b>another</b> paragraph.
</p>

How to Create an HTML Document

We will create here an HTML file that displays “Hello world” message in your web browser.

Step# 1: Create an HTML file

Open a plain text editor and create a new file

Use Notepad (on Windows), TextEdit (on Mac) or some other text editor to do this; don’t use Word or WordPad!

Step #2: Type HTML code

<!DOCTYPE html>
<html>
<head>
<title>A simple HTML document</title>
</head>
<body>
<p>Hello World!<p>
</body>
</html>

 

Step #3: Save the file

Now save the file as “firstwebpage.html ”

Always specify that the extension as .html — some text editors like Notepad will automatically save it as .txt otherwise.

To open the file in a browser:

Double click on your file. It will open in your default browser. If it doesn’t, open your browser and drag the file to it.

See  Also

How to link Page to another in HTML

error: Content is protected !!