DEV Community

Sudhakar V
Sudhakar V

Posted on

HTML Basic Structure

Here’s the basic structure of an HTML document:


<html>
<head>
<title>www.sk.org</title>
</head>
<body>
<h1> Sudhakar</h1>
<p2>A paragraph is a fundamental unit of written text, typically consisting of one or more sentences that develop a single, unified idea or topic. It serves to organize longer pieces of writing and make them more readable</p2>
</body>
<html>






### **Key Sections**:
1. **`<!DOCTYPE html>`**  
   - Declares the document type (HTML5).

2. **`<html>`**  
   - Root element; wraps all content.  
   - `lang="en"` defines the language (English).

3. **`<head>`**  
   - Contains **meta-information** (not displayed on the page):  
     - `meta charset="UTF-8"` (character encoding).  
     - `viewport` (responsive design settings).  
     - `title` (tab/window title).  
     - Links to CSS (`<link rel="stylesheet">`).  

4. **`<body>`**  
   - Holds **visible content** (headings, paragraphs, images, etc.).  
   - JavaScript files (`<script>`) are usually placed at the end for faster loading.

### **Basic Elements Inside `<body>`**:
- **Headings**: `<h1>`, `<h2>`, etc.  
- **Paragraphs**: `<p>`.  
- **Links**: `<a href="url">Link</a>`.  
- **Images**: `<img src="image.jpg" alt="Description">`.  
- **Lists**: `<ul>`, `<ol>`, `<li>`.  
- **Divisions**: `<div>` (container for styling/JS).  

### **Notes**:
- **Self-closing tags**: `<img>`, `<meta>`, `<br>` (no `</img>` needed).  
- **Comments**: `<!-- This is a comment -->`.  

This structure is the foundation of every HTML page. 🏗️
Enter fullscreen mode Exit fullscreen mode

Top comments (0)