Learn the fundamentals of HTML, the backbone of all web pages
.html
extension. They consist of elements that are defined by tags. Browsers read HTML documents and render them into visible or audible web pages.
DOCTYPE Declaration
<!DOCTYPE html>
tells the browser that this is an HTML5 document.HTML Element
<html>
element is the root element that contains all other elements.Head Section
<head>
element contains meta-information about the document, such as its title, character encoding, and links to external resources.Body Section
<body>
element contains all the content that is visible on the webpage.<h1>
(most important) to <h6>
(least important).
<p>
element defines a paragraph of text.
<a>
(anchor) element creates hyperlinks to other web pages or resources.
<img>
element embeds images in your webpage.
alt
attribute in your image tags. It provides a text
description for screen readers and displays if the image fails to load.<ol>
), unordered lists (<ul>
), and definition lists (<dl>
).
id
: Specifies a unique identifier for an elementclass
: Specifies one or more class names for styling with CSSstyle
: Contains inline CSS stylingsrc
: Specifies the URL of external resources like imageshref
: Specifies the URL of a linked resource<header>
, <footer>
, <article>
, and <section>
that clearly describe their meaning.<audio>
and <video>
elements.<canvas>
element for drawing graphics via JavaScript.