Edit and Run HTML code

Previous
Next

Edit and Run HTML File:

  • We can simply edit the HTML code using universal editor(Notepad)
  • We edit the code and save with extension(.html)
  • When we save the file, it shows the file with browser icon in location.
  • When we double click on file that will open with browser window and shows the output.
<html>
	<head>
	</head>
	
	<body>
	Welcome to html 
	</body>
</html>
  • Here whatever you would like to display on web page, you have to write that code in body.
  • Here the browser’s interpreter executes the code and displays the message (welcome to html) in the body of that webpage.
<html>
	<head>
	</head>

	<body>
		body
		Welcome to html 
	</body>
</html>

In the above program we wrote the word ‘body’ without using angle brackets. So it will not exhibit any kind of functionality. It will directly display on screen.

<html>
	<head>
	</head>

	<body>
	<img
	</body>
</html>
  • Observe the above program here, even though we did not close the image tag browser will display an image file on the web page.
  • That means the browser thinks that <img </body > is the property of the <img> tag.
  • Browser ignores the invalid properties of elements
  • It will display like below.
Previous
Next

Add Comment

Courses Enquiry Form