HTML Basic
HTML Basic
language used to create web pages. It's the foundation of every web page you see
on the internet. HTML is not a programming language; it's a markup language
used to structure content on a web page.
Basic explanation of HTML for beginners:
1. HTML Document Structure: An HTML document is a text file with a .html
file extension. It consists of various elements, which are enclosed in angled
brackets < >. An HTML document typically contains two main sections:
<!DOCTYPE>: This declaration defines the document type and version
of HTML being used. For modern web development, you typically see
<!DOCTYPE html>, which signifies HTML5.
<html>: The root element that encloses all other elements in the
document. It has two child elements:
<head>: Contains meta-information about the document, like
the page title and links to external resources (CSS stylesheets,
JavaScript files, etc.).
<body>: Contains the visible content of the web page,
including text, images, links, and more.
2. Elements and Tags: HTML consists of various elements or tags, which are
used to define the structure and content of a web page. An element
consists of an opening tag, content, and a closing tag.
For example:
<p> is the opening tag.
3. Attributes: HTML elements can have attributes that provide additional information about the
element. Attributes are placed within the opening tag and have a name and a value. For
example:
In this example, src and alt are attributes of the <img> element.
4. Nesting:
HTML elements can be nested inside one another. This means you can have elements within other
elements to create a hierarchy and structure your content. For example:
5. Common HTML Elements: HTML offers a wide range of elements for various purposes, including
headings, paragraphs, links, lists, images, and more. Here are a few common ones:
<a>: Hyperlinks.
<img>: Images.