Basic HTML
Text Elements in HTML
Headings (<h1>
to <h6>
)
HTML provides six levels of headings, from <h1>
(the most important) to <h6>
(the least important). Headings help structure content and make the information hierarchy clearer for users and search engines.
html
Paragraphs (<p>
)
The <p>
tag is used to create paragraphs of text. Each paragraph will be separated by a space on the page.
html
Emphasis and Importance (<em>
, <strong>
)
HTML has tags to add emphasis and highlight the importance of certain words or phrases. The <em>
tag provides emphasis, while <strong>
indicates importance or urgency.
html
Line Breaks (<br>
)
The <br>
tag is used to insert a line break without starting a new paragraph. It's useful for address lists or poetry where continuous text formatting is required.
html
Horizontal Rules (<hr>
)
The <hr>
tag creates a horizontal line to divide content sections. It doesn't have a closing tag and can be used to separate topics or sections.
html
Quotes (<blockquote>
, <q>
)
For quoting external content or highlighting quotes, HTML uses <blockquote>
for long quotes and <q>
for brief inline quotes.
html
Code Formatting (<code>
, <pre>
, <kbd>
, <samp>
, <var>
)
HTML also offers tags to display code and technical text. The <code>
tag is for inline code snippets, <pre>
preserves text formatting, <kbd>
represents user input, <samp>
shows output, and <var>
indicates a variable.
html
Chapter Closure
Now that you know the basic elements for formatting text content in HTML, you can structure and highlight information effectively on your web pages. In the next chapter, we'll learn about lists and how to group content in various ways.
- Introduction to HTML
- Text Elements in HTML
- Lists in HTML
- Links and Navigation
- Images and Multimedia Content
- Tables in HTML
- Forms in HTML
- HTML Head and Metadata
- Semantic HTML
- HTML5 APIs and Advanced Elements
- iFrames and HTML Embeddings
- Data Representation with HTML
- Accessibility in HTML
- Best Practices for HTML
- HTML and SEO
- HTML for Responsive and Mobile Design
- Integration of HTML with JavaScript
- Creating a Simple Website