HTML (HyperText Markup Language) is the standard markup language for creating web pages. Here’s an example of a simple HTML document that displays “Hello, World!” on the web page:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Document</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Let me break down the different parts of this code:
<!DOCTYPE html>The document's HTML5 status is defined by its precise declaration.
<html>
This is the root element of an HTML page.<head>
This element contains meta-information about the document, such as its title and any CSS stylesheets.<title>
This element specifies the title of the web page, which is displayed on the web browser’s title bar or tab.<body>This element is also one that has the content that is shown on the webpage.
<h1>
This element defines a heading. In this case, it’s the highest-level heading, which is displayed in a large font size.
To write your own HTML document, you can copy and paste this code into a text editor, such as Notepad or Sublime Text, and save the file with a .html
extension. Then, open the file in a web browser, such as Google Chrome or Mozilla Firefox, to see your web page in action!
I hope this helps you get started with HTML.
About Author
Discover more from SURFCLOUD TECHNOLOGY
Subscribe to get the latest posts sent to your email.