Scanner class Methods in Java

How to write and save first program in HTML

Creating HTML document


Let us create a simple HTML document to print "Hello!! World" and title of document will be "Welcome"
You can create your first simple HTML document in Notpad text editor.

Code:

<html>
<head>
<title> Welcome</title>
</head>
<body>
          Hello!! World
</body>
</html>

In Notepad the code will look like this:

Writing and Executing a HTML program in Notepad

Output:

Writing and Executing a HTML program in Notepad

In the above example, The "Welcome"  written in the Title bar is the title of your document. The text that is written in body will display in the main area of  browser.

Saving HTML document

Saving HTML document is very easy task . The extensions that are used to save HTML documents are .html or .htm , if you save HTML document with these extensions then you can view them in browser , else if you save HTML document with .txt then the file will become only text file.

So remember to use .html or .htm extension while saving a HTML document.

Steps :

  1. Write code in Notepad.
  2.  Then Go to file>Save or Save as  OR  Press Ctrl+S to save the document.
  3.  A Save As wizard will appear . As follow                                                                                                                                                                                                                              
    Saving HTML program                                           
  4. Write the name of document as shown above and Add extension.
  5. Then Click Save.
Your document is saved. Now you can see it in browser by Double clicking on it.Try it Yourself!

Comments