Overview
Once you understand the basic HTML document structure, the next step is to populate it with meaningful content. This lesson focuses on the fundamental HTML elements used for structuring and formatting text, making your content readable and organized. We'll also cover how to create hyperlinks, allowing users to navigate between pages and external resources, which is essential for the interconnected web.
Key Points
-
Headings: HTML offers six levels of headings, from
<h1>(most important) to<h6>(least important), used to structure content hierarchically. -
Paragraphs: The
<p>tag is used to define a paragraph of text, separating blocks of content for better readability. -
Text Styling: Elements like
<strong>for strong importance (often bold) and<em>for emphasized text (often italic) provide semantic meaning and default visual styling. -
Lists: HTML supports ordered lists (
<ol>) for sequential items and unordered lists (<ul>) for non-sequential items, both using<li>for individual list items. -
Hyperlinks (
<a>): The anchor tag<a>creates hyperlinks. Itshrefattribute specifies the destination URL, while the text between the tags is what users click. -
Link Targets: The
target="_blank"attribute on an<a>tag can open the linked document in a new browser tab or window.
Quick Example
Here's how to use some common text formatting and a hyperlink:
html<h1>Welcome to My Blog</h1> <p>Read about my journey into <strong>web development</strong>.</p> <h2>My Favorite Hobbies</h2> <ul> <li>Reading</li> <li>Coding</li> <li>Hiking</li> </ul> <p>Visit <a href="https://example.com" target="_blank">my portfolio</a> for more!</p>
Summary
This lesson equipped you with the HTML elements necessary to format text effectively using headings, paragraphs, and lists. You also learned the crucial <a> tag for creating hyperlinks, enabling navigation within and outside your website. These elements are fundamental for presenting clear, navigable textual content on the web.