Introduction to HTML

How HTML provides the structure and meaning of web pages

What Is HTML?

HTML stands for HyperText Markup Language. It is the standard markup language used to describe the structure and meaning of content on a web page. HTML tells a browser which content is a heading, paragraph, list, link, image, or another type of element.

HTML is not a programming language. It uses elements and attributes to organize information so browsers and other tools can interpret and present it. A page can be written in HTML alone, although most modern websites also use CSS for styling and JavaScript for interactive behavior.

How HTML Elements Work

Most HTML elements have an opening tag, content, and a closing tag. For example, <p> starts a paragraph and </p> ends it. Some elements, such as <img>, are void elements and do not have closing tags.

Elements describe the purpose of content. The <h1> element identifies a top-level heading, <a> creates a hyperlink, and <ul> contains an unordered list. Using the appropriate element makes a document easier to understand and navigate.

The Structure of an HTML Document

An HTML document typically begins with <!doctype html>, followed by an <html> element. Inside it, the <head> contains document information, such as the page title and links to stylesheets. The <body> contains the content shown in the browser window.

This example website uses semantic elements such as <header>, <nav>, <main>, <section>, and <footer>. These elements help identify the roles of different parts of a page.

HTML Attributes

Attributes provide additional information about an element. For example, an anchor element uses the href attribute to specify a link destination. An image element uses src to identify an image file and alt to provide a text alternative.

The links in this site's navigation use paths such as /articles/css.html. The leading slash makes the path relative to the root of kdwhd.com, so it works consistently from both the homepage and article pages.

How HTML, CSS, and JavaScript Work Together

HTML provides the content and structure of a page. CSS controls its appearance, including colors, fonts, spacing, and responsive layouts. JavaScript can respond to user actions and update content without requiring an entirely new page.

On this example website, HTML defines the navigation links, CSS styles the layout, and JavaScript controls the mobile navigation menu and displays the current year in the footer.

Continue Exploring Web Development

HTML is the foundation of web content, but it becomes more flexible when combined with CSS and JavaScript. Visit the CSS article to learn how styles change the presentation of HTML elements.

Explore CSS