The <p>
tag defines a paragraph in HTML. By default,
paragraphs are block-level elements, which means they take up the full
width available and each paragraph starts on a new line (we'll talk more
about this when we see div vs. span).
You can add multiple paragraphs like this to separate text, making your content more readable.
HTML has undergone several versions since its inception. The current version, HTML5, introduced many new features and elements that improve the way we build modern websites and applications.
Some of the key reasons for the continuous evolution of HTML are to address emerging web development needs, ensure better compatibility with new devices, and offer more powerful tools for creating complex web pages. HTML5 also focuses on simplifying code and removing outdated or redundant elements, making web development more efficient.
HTML5 brings new semantic elements like <article>
,
<section>
, and <nav>
that help
define the structure of your content more clearly. It also supports
multimedia with elements like <audio>
and
<video>
, eliminating the need for third-party plugins.
This version emphasizes making content more accessible and maintaining a
cleaner, more meaningful structure.
A crucial feature of HTML5 is its backwards compatibility. Older websites built with earlier HTML versions will still work in modern browsers, ensuring a smooth transition as new features are introduced.
HTML ignores extra whitespace characters such as spaces, tabs, and newlines, treating them as a single space. For example, if you type multiple spaces or press 'Enter' several times in your code, the browser will collapse these into a single space when rendering the page.
This is why it's common to see HTML written in an indented format, as it
helps organize code without affecting the actual layout. To add
intentional whitespace, use the <br>
tag to create a
line break or the
entity to insert a non-breaking
space.
Like that.
Next: Lists in HTML Previous: Headings