Day 4 - Adding Headings, Paragraphs, and Line Breaks
Welcome back to Day 4 of our 30-day HTML tutorial series! In today's lesson, we're going to explore how to structure your web content using HTML headings, paragraphs, and line breaks. These are fundamental elements that play a crucial role in organizing and presenting your information effectively.
Adding HTML Headings
HTML provides six levels of headings, from (the highest) to (the lowest). Headings are used to define the structure and hierarchy of your content.
Here's how to use headings in your HTML document:
<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
<h4>This is a Heading 4</h4>
<h5>This is a Heading 5</h5>
<h6>This is a Heading 6</h6>
Headings are not just for making text larger or bold; they have semantic meaning. represents the highest-level heading and should be used for the main title of your page. Subsections or subheadings within your content can be marked with , , and so on, based on their importance and hierarchy.
Creating Paragraphs
Paragraphs are used for structuring text content. You can create a paragraph using the element:
<p>This is a paragraph of text. It can contain multiple sentences and provides a clear separation between different blocks of content.</p>
Inserting Line Breaks
Sometimes, you may want to add a simple line break within a paragraph, for example, when creating an address or poem. You can use the element for this purpose:
<p>This is the first line.<br>This is the second line.</p>
Putting It All Together
Now, let's see these elements in action by updating our HTML document from Day 3:
<!DOCTYPE html>
<html>
<head>
<title>Your Page Title</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text. It can contain multiple sentences and provides a clear separation between different blocks of content.</p>
<h2>About Me</h2>
<p>I'm passionate about web development and enjoy sharing my knowledge with others.</p>
<p>Contact me at: example@email.com</p>
</body>
</html>
In this updated example, we've added headings, paragraphs, and even a line break to improve the structure and readability of our webpage.
These are just the basics, but headings, paragraphs, and line breaks are essential elements for building well-structured and organized web content.
Copyright (c) 2023 by sunraja1996 (https://codepen.io/sunraja1996/pen/dywQjJE)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Comments
Post a Comment
Thank You !