HTML Basic
3 min read ·
Understanding HTML at a Basic Level
HTML stands for HyperText Markup Language.
It is the standard language used to create and structure content on the web.
HTML does not perform logic or calculations.
Its purpose is to describe the structure of a web page so that browsers know how to display content.
Structure of an HTML Page
Every HTML page follows a defined structure that browsers understand.
An HTML file is made up of elements enclosed within tags.
The browser reads the document from top to bottom.
HTML Document Declaration
At the top of every HTML page, a document declaration is required.
This declaration informs the browser that the document follows modern HTML standards.
It helps ensure consistent rendering across different browsers.
The declaration is written only once in the entire document.
HTML Root Element
The
<html> tag represents the root of the HTML document.All content of the page must exist inside this tag.
This tells the browser where the HTML document begins and ends.
HTML Body Element
The
<body> tag contains all visible content shown to users.Text images links and headings are written inside the body element.
Anything outside the body is not displayed directly.
Example of a Simple HTML Page
This example demonstrates the minimum structure required to display content in a browser.
HTML Headings Explained
Headings are used to define titles and sections.
HTML provides six levels of headings.
Larger heading numbers represent lower importance.
Headings improve content organization and accessibility.
HTML Paragraphs Explained
Paragraphs are used to display blocks of text.
They are created using the
<p> tag.Browsers automatically add spacing between paragraphs.
HTML Links Explained
Links allow navigation from one page to another.
They are defined using the
<a> tag.The destination address is provided using the
href attribute.Attributes add extra information to HTML elements.
HTML Images Explained
Images are added using the
<img> tag.The image tag does not have a closing tag.
Attributes define the image source description and size.
Viewing HTML Code in the Browser
Browsers allow users to see how a web page is built.
Viewing Page Source
You can view the complete HTML of a page by using the browser source option.
This shows the raw HTML code used to create the page.
Inspecting Elements
The inspect option shows the live structure of a web page.
It allows viewing and temporarily modifying HTML and CSS.
This tool is widely used for learning debugging and testing layouts.