HTML : Introduction

HTML, or Hypertext Markup Language, is the standard language used to create and design web pages. It provides the basic structure for organizing content on the internet. Let's break down some key concepts:

  1. Hypertext: HTML stands for Hypertext Markup Language. Hypertext refers to text that contains links to other texts or documents. This linking feature is what makes the web so interconnected.

  2. Markup Language: HTML is a markup language, not a programming language. This means it uses tags to define elements within a document, rather than using code to perform functions. Tags are special keywords enclosed in angle brackets < > that specify how elements should be displayed on a webpage.

  3. Structure: HTML provides the structure of a webpage. This includes elements such as headings, paragraphs, lists, images, links, and more. Each element is represented by a specific HTML tag.

  4. Semantic HTML: Semantic HTML refers to using HTML tags that convey meaning about the content they contain. For example, using <header>, <nav>, <article>, <section>, and <footer> tags to structure your page, instead of using generic <div> tags. This not only improves accessibility but also helps search engines understand the content of your page better.

  5. Attributes: HTML tags can have attributes, which provide additional information about an element. Attributes appear within the opening tag of an element and are typically name-value pairs. For example, the <img> tag uses the src attribute to specify the image file's source.

  6. Basic Structure: Every HTML document starts with a <!DOCTYPE html> declaration, which tells the browser that the document is written in HTML5, the latest version of HTML. Following that, the document is enclosed within <html> tags, and inside that, you have <head> and <body> sections. The <head> section contains meta-information about the document, such as its title and links to external resources, while the <body> section contains the content visible to users.

Here's a simple example of a basic HTML document:

<!DOCTYPE html> 
<html> 
<head> 
<title>My First Web Page</title> 
</head> 
<body> 
<h1>Hello, World!</h1> 
<p>This is my first webpage.</p> 
</body> 
</html> 

 

In this example:

  • <!DOCTYPE html> declares the document type and version.
  • <html> encloses the entire HTML document.
  • <head> contains meta-information about the document.
  • <title> sets the title of the document, which appears in the browser's title bar or tab.
  • <body> contains the visible content of the document.
  • <h1> is a heading element, and <p> is a paragraph element.

That's a basic introduction to HTML! As you continue learning, you'll discover more elements, attributes, and techniques for creating rich and interactive web pages.