Creating WebPages in HTML is very easy. As I mentioned before, there is a combination of an HTML program text and tags. Therefore, it is important that if you have not read "HTML tags" yet, then before learning this tutorial, please learn HTML tags.
In this section, you will learn how to write your HTML program and next section, you will learn how to run the program in the form of an HTML webpage.
How to setup Environment for HTML?
REQUIREMENT
1. Computer: - At least you should have a computer where you can install the required software to write and run your HTML program. Also, you can use Laptop/Mobile.
2.Text Editor: - This is important where you can write HTML programs. Such as Notepad++, Sublime, Atom and brackets etc.
3. Browser: - You should have browser software installed on your computer to run and display the output of your HTML programs. Such as Google Chrome, Mozilla Firefox, Internet Explorer and Safari etc.
4. Internet: - Internet connection is optional. If you have it will be better for you.
Choosing Text Editor for Writing HTML Program
You need a text editor to create WebPages via HTML. You can use any text editor for this. A list of some popular text editors is being given below.
Notepad:- This text editor is provided default by the Windows operating system. You can open it from the start menu. This text editor is quite simple and plane there are no features like line numbers and code color.
Click on Winkey(Windows Logo) --> Type Notepad
Or
Start --> All Programs --> Accessories --> Notepad
Notepad + +:- This text editor is provided by the notepad-plus-plus.org website. It is considered an advanced version of notepad. This is a free source code editor. This editor has provided many useful features related to programming.
Sublime Text:- Sublime text is a sophisticated text editor. The user interface of this editor is very good. This text editor provides you the equivalent features of the IDE. You can download it from sublimetext.com.
Common Structure of HTML Program
All HTML files follow a common structure. This structure is formulated by basic tags. It is mandatory to use all basic tags in every HTML file. The basic structure of HTML is being explained below.
<html>
<head>
<title> Title of your webpage </ title>
</ head>
<body>
Your text content Should be here.
</body>
</html>
Every HTML file should be start and end with <html> tag. After the HTML tag the <head> tag is define. Inside the <head> tag you define the title of the web page with <title> tag.
The webpage is displayed in the title browser above the menu bar. The <body> tag is define after the <head> tag. The main content of the webpage is written in the <body> tag.
Simple HTML Program
<html>
<head>
<title> This is a title of first webpage </ title>
</ head>
<body>
<h1> This is a main heading of first webpage </ h1>
</ body>
</ html>
In this program, only <h1> tag has been added in the <body> tag except basic tags. This tag shows text as the main heading. Write this program in your text editor.
Interpreting a HTML Program
To view any HTML program/code as a webpage. First, you have to save it with .html extension. By default in the text editor, when you save a file, it is saved with the .txt extension. So while saving the HTML file, you have to put a .html extension after its name.
Web browser interpreter interprets the HTML file as a webpage, which has an extension .html This extension lets the interpreter know that the file is an HTML file. Therefore it is mandatory to save the HTML file with the .html extension.
Web browser interpreter interprets the same file as a webpage, which has an extension .html This extension lets the interpreter know that the file is an HTML file. Therefore it is mandatory to save the HTML file with the .html extension.
As soon as you save the file with the .html extension then the interpreter will interpret your file and your file will appear with the browser icon at the saved location. The icon will display only with the default browser in your computer. This means that it is a webpage.
If there is an error in your code then the HTML page will not show you. One thing you should keep in mind is that there is no error reporting feature in HTML. So if there is an error in your code then you have to find it by itself and fix it.
0 comments:
Post a Comment
Thank you for reading the post.