Introduction:
We design many pages every day, every time we always give a title, different headings, and paragraphs in most of the cases. Now think of designing a web page using HTML, here we also use page titles, headings, and paragraphs. In this blog, we will study how to create page titles, headings, and paragraphs in HTML.
Page titles: The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.
Headings: HTML contains different headings that are defined from <h1> to <h6>. Generally <h1> is the biggest font and <h6> will give the smallest font on your webpage.
Paragraphs: In HTML we define paragraphs using <p>, it always starts on a new line. The browsers automatically add white space or a simple margin before and after a paragraph. Paragraph tags automatically give one-line margins.
Now let’s dive into the topic and see its implementation too..!!

HTML <title> Tag:
The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.
The <title> tag is required in HTML documents!
The contents of a page title are very important for search engine optimization (SEO)! The page title is used by search engine algorithms to decide the order when listing pages in search results.
The <title> element:
- defines a title in the browser toolbar
- provides a title for the page when it is added to favorites
- displays a title for the page in search engine results
Here are some tips for creating good titles:
- Go for a longer, descriptive title (avoid one- or two-word titles)
- Search engines will display about 50-60 characters of the title, so try not to have titles longer than that
- Do not use just a list of words as the title (this may reduce the page's position in search results)
So, try to make the title as accurate and meaningful as possible!
Note: You can NOT have more than one <title> element in an HTML document.
Now let’s check out the implementation part:
Code:
|
Output:
Page title: CodingNinjas will be displayed as your tab name.
You can check the
HTML Paragraphs:
A paragraph is used if you want to finish what you are talking about and start a new conversation.
-
If you want to explain something on your web you use a paragraph.
-
For a paragraph we use a <p> tag.
In HTML we have different tags to display the paragraphs, to break them into a single line, and many more. Below are some tags used in paragraphs. Let’s see the implementation of these tags and paragraphs.
Tag | Description |
<p> | Defines a paragraph |
<br> | Inserts a single line break |
Code:
|
Output: