Skip to main content

Command Palette

Search for a command to run...

HTML for Beginners: How to Build a Simple Webpage with a Minimal Amount of Code

Published
2 min read
HTML for Beginners: How to Build a Simple Webpage with a Minimal Amount of Code

HTML Stands for " hypertext markup language "

The amount of lines of code in a simple HTML webpage can vary greatly depending on the complexity of the webpage. A basic HTML webpage with just text and a few headings may only have a few dozen lines of code, while a more complex webpage with multiple pages, images, and interactive elements could have several hundred lines of code or more.

As a reference, a simple HTML page with only text and a title could look like this:

<!DOCTYPE html>
<html>
<head>
  <title>My Simple Webpage</title>
</head>
<body>
  <h1>Welcome to my webpage!</h1>
  <p>This is a simple webpage created with HTML.</p>
</body>
</html>

This webpage has only 12 lines of code, but again, it's just a simple example of what a webpage could look like. The actual number of lines can be much more than this.

This is final output from this code ..

Above code describe in simple words :

  1. <!DOCTYPE html> declares that this is an HTML5 document.

  2. <html> is the root element of an HTML page.

  3. <head> element contains meta information about the document, such as the title of the page, which is displayed in the browser's title bar or tab.

  4. <title>My Simple Webpage</title> is the title of the webpage, which is displayed in the browser's title bar or tab.

  5. <body> element contains the visible page content.

  6. <h1>Welcome to my webpage!</h1> creates a heading level 1 with the text "Welcome to my webpage!"

  7. <p>This is a simple webpage created with HTML.</p> creates a paragraph with the text "This is a simple webpage created with HTML."

  8. </body> and </html> are closing tags for the <body> and <html> elements, respectively.