So far, we already have learned about the structure of an HTML document, tags etc. Let us use this knowledge to create our first web page which will print the text “Hello World!” on the screen.
Open your text editor, and type the below code in it and save it with the name “index.html”:
On opening the file in a web browser, you will see the below output:
Yes, it’s that easy to print anything on the Web Page. You don’t need to compile your HTML code to run it in an Web Page. As HTML is an scripting language, you can simply change your code and hit the referesh button and the changes will be reflected to your Web page immediately.
Make “Hello World!” Bigger: The text “Hello World!” seems to appear small. Let us make it look a bit more bigger.
We have seen usage of <h1/> tags in our previous articles. This is a heading tag in HTML which is used to represent headings in a Web Page.
Heading Tags: There are six levels of headings defined by HTML. These six heading
elements are H1, H2, H3, H4, H5, and H6; with H1 being the highest level and H6 the least.
Let us use these six different Heading tags separately to print “Hello World!” and see the difference. Modify your code in index.html with the below code:
On refreshing the web page you will see the output will change to:
To learn more about Heading Tags, Please refer: HTML | Heading.
- Hello World Program : First program while learning Programming
- How to hide an element when printing a web page using CSS?
- Hello World in TypeScript
- Web 1.0, Web 2.0 and Web 3.0 with their difference
- How to redirect a page to another page in HTML ?
- ES6 | Page Printing
- How to Remove URL from Printing the Page ?
- How to display search result of another page on same page using ajax in JSP?
- How to show Page Loading div until the page has finished loading?
- How to pass form variables from one page to other page in PHP ?
- Download web page using Java
- How to disable zoom on a mobile web page using CSS?
- How to get the size of screen, current web page and browser window using jQuery?
- How to create footer to stay at the bottom of a Web page?
- How to add custom google search bar inside your web-page?
- How to animate the drawing on a web page?
- How to detect which one of the defined font was used in a web page?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.