HTML Basic

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

HTML, which stands for HyperText Markup Language, is the standard markup

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.

 This is a paragraph. is the content.

 </p> is the closing 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:

 <h1>, <h2>, <h3>, ... <h6>: Headings of different levels.

 <p>: Paragraphs of text.

 <a>: Hyperlinks.

 <ul>: Unordered lists (bulleted lists).

 <ol>: Ordered lists (numbered lists).

 <li>: List items.

 <img>: Images.

 <div>: A generic container for grouping elements.


6. Comments: You can add comments in your HTML code to provide explanations or notes.
Comments are not visible in the web page and are written like this:

7. Whitespace and Indentation: HTML doesn't care about the amount of


whitespace or indentation you use. However, using consistent indentation and
line breaks can make your code more readable.

You might also like