Welcome to the HTML Basics section! If you're new to web development or looking to refresh your knowledge, you're in the right place. HTML (Hypertext Markup Language) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as CSS (Cascading Style Sheets) and JavaScript.

Basic Structure of an HTML Document

Every HTML document starts with a <!DOCTYPE html> declaration, followed by the opening <html> tag. Inside the <html> tag, you will typically find a <head> section and a <body> section.

  • : This declaration defines the document type and version of HTML. For HTML5, it is simply <!DOCTYPE html>.
  • : The root element that encloses all the content of your HTML document.
  • : Contains meta-information about the document, such as its title and links to CSS files.
  • : Contains the content of the document, such as text, images, links, etc.

Here is a simple example of an HTML document structure:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>

  <h1>This is a Heading</h1>
  <p>This is a paragraph.</p>

</body>
</html>

Elements and Attributes

HTML elements are the building blocks of HTML pages. Elements are defined by tags, and most HTML elements have attributes that provide additional information about the element.

Elements

Attributes

Attributes provide additional information about HTML elements. For example, the <a> element can have an href attribute that specifies the URL of the link.

Here's an example of an element with an attribute:

<a href="https://www.example.com">Visit Example</a>

HTML Entities

HTML entities are used to represent special characters in HTML documents. For example, &lt; is the HTML entity for the less-than symbol (<).

Here's a list of common HTML entities:

  • &lt; - Less than (<)
  • &gt; - Greater than (>)
  • &amp; - Ampersand (&)
  • &quot; - Double quote (")
  • &apos; - Single quote (')

Further Reading

To learn more about HTML, you might want to check out our comprehensive guide on HTML Elements.


HTML Elements