HTML Tutorial
- HTML HOME
- HTML Introduction
- HTML Editors
- HTML Basics
- HTML Comments
- HTML Elements
- HTML Attributes
- HTML Headings
- HTML Paragraphs
- HTML Styles
- HTML Text Formatting
- HTML Quotations
- HTML Colors
- HTML Links
- HTML Images
- HTML Favicons: How to Add and Optimize for All Browsers
- HTML Page Title: How to Optimize Titles for SEO Success
- HTML Tables: Create & Optimize for Better Web Design | Codeezy
- HTML Lists: Types, Examples & SEO Tips for Better Structure
- HTML Block and Inline Elements
- HTML Iframes
- HTML File Paths
- HTML Layout
- HTML Computer Code Elements
- HTML Semantics
- HTML5 Semantics
- HTML Entities
- HTML Symbols
- HTML Emojis
- HTML Charsets
HTML Basics
HTML, or HyperText Markup Language, is the backbone of web development, forming the structure and content of web pages. Understanding HTML is essential for anyone interested in creating or designing websites. This guide will walk you through the fundamental aspects of HTML, from basic tags to more advanced elements, and provide practical examples to help you get started.
What is HTML?
HTML stands for HyperText Markup Language and serves as the standard language for creating web pages. It uses a system of tags to define elements on a page, instructing the web browser on how to display content. HTML structures the content, creating a framework that other technologies like CSS and JavaScript enhance.
Table of Contents
- Basic HTML Document Structure
- HTML Headings
- HTML Paragraphs and Breaks
- HTML Horizontal Lines
- HTML Images
- Viewing HTML Source Code
- FAQs – HTML Basics
Basic HTML Document Structure
Every HTML document begins with a declaration that defines the document type and version of HTML being used. This is followed by the main HTML structure, which includes the <html>
, <head>
, and <body>
tags. Here’s a basic template:
Basic HTML Tags
Tag | Description |
---|---|
<html> | Encloses the entire HTML document. |
<head> | Contains metadata and links to external resources like stylesheets and scripts. |
<title> | Defines the title of the document, shown in the browser’s title bar or tab. |
<body> | Encloses the visible content of the webpage, such as text, images, and links. |
Example 1: Basic HTML Document
HTML Basics
Welcome to the HTML basics guide!
Output:
A simple webpage with a paragraph displaying “Welcome to the HTML basics guide!”
HTML Headings
Headings are essential for structuring content and improving readability. HTML provides six levels of headings, from <h1>
to <h6>
, each decreasing in size.
Syntax:
Main Heading
Subheading
Sub-subheading
Example 2: HTML Headings
HTML Headings
Heading Level 1
Heading Level 2
Heading Level 3
Heading Level 4
Heading Level 5
Heading Level 6
Output:
Headings ranging from large (h1) to small (h6).
HTML Paragraphs and Breaks
Use the <p>
tag to create paragraphs, and the <br>
tag for line breaks. The <p>
tag automatically adds space before and after paragraphs, while <br>
inserts a single line break without additional spacing.
Syntax:
This is a paragraph.
Example 3: Paragraphs and Breaks
Paragraphs and Breaks
HTML stands for HyperText Markup Language.
It structures web pages using a markup language.
HTML defines the layout and links between pages.
It includes various elements and attributes to format content.
Output:
A paragraph with line breaks separating each sentence.
HTML Horizontal Lines
The <hr>
tag creates a horizontal line across the page, useful for dividing sections or content.
Syntax:
Example 4: Horizontal Lines
Horizontal Lines
Section 1
Content for the first section.
Section 2
Content for the second section.
Output:
Content separated by horizontal lines.
HTML Images
The <img>
tag inserts images into a webpage. The src
attribute specifies the image source, while the alt
attribute provides alternative text for accessibility.
Syntax:
Example 5: Inserting Images
Images in HTML
Output:
Displays a placeholder image.
Viewing HTML Source Code
To view the HTML code of a webpage:
- Entire Page: Press
Ctrl + U
or right-click and select “View Page Source.” - Specific Element: Right-click the element and choose “Inspect” to view its HTML and CSS in the browser’s developer tools.
FAQs – HTML Basics
1. What are the basics of HTML?
Basics include understanding the document structure, HTML tags, attributes, and elements.
2. What are the fundamental rules of HTML?
- The basic structure includes
<!DOCTYPE>
,<html>
,<head>
,<title>
, and<body>
. - Tags are enclosed in
<
and>
, with opening and closing tags (e.g.,<h1>...</h1>
). - HTML is case-insensitive.
3. What are the uses of HTML?
HTML is used to create and structure web pages, embed multimedia, and establish hyperlinks. It forms the foundation of web content.
Thank You for Visiting Codeezy.org!
We’re thrilled to have you as part of our coding community. Your engagement and support inspire us to continue providing high-quality resources and tools to enhance your web development journey. Whether you’re a beginner or an experienced coder, we hope you found valuable insights and tools here at Codeezy.
Stay connected for more tips, tutorials, and updates to help you code with ease. Thank you for choosing Codeezy.org—your growth as a developer is our motivation!
Happy coding!