Introduction to Paragraphs in HTML
Hey friends 👋 welcome back. In the last lesson, we learned what HTML is and how to set up a simple webpage. Today, we are going to look at one of the most basic but very important tags in HTML — the paragraph tag.
A paragraph is simply a block of text on a web page. In books or stories, we separate ideas into paragraphs to make them easier to read. HTML does the same thing for websites. The tag for a paragraph is <p> and it always comes in pairs: <p> ... </p>.
Here is a simple example:
When you open this file in your browser, you will see two paragraphs of text. Each one is inside its own <p> tags. The browser automatically adds some space before and after each paragraph, so the text does not look squeezed together.
You can add as many paragraphs as you like. Every time you want to start a new idea, just open a new <p> tag and close it after your text. This keeps your webpage neat and easy to read.
Here’s another example with three paragraphs:
You can also style your paragraphs with CSS to make them look better. For example, you can change the color, font size, or spacing between lines. Try this small style inside the <head> tag:
This will make all your paragraphs green, slightly larger, and easier to read.
Paragraphs may seem simple, but they are the foundation of almost every webpage. Every article, blog post, or story you read online is made up of many paragraphs. Learning how to use them properly is the first step to organizing your website’s content.
Now it’s your turn. Open your editor, create a file called paragraphs.html, and write at least three paragraphs about your favorite hobby, food, or dream project. Save it, open it in your browser, and see how it looks.
Great job 🎉 You just learned how to use the paragraph tag in HTML. In the next tutorial, we will explore headings (<h1> to <h6>) and see how to use them to give structure to your webpages.
2 Comments
I love the way the tutorials are detailed
ReplyDeleteOoh Thanks
Delete