- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use title tag in HTML Page?
Titles are used to grab attention and predict the content of the web page.
The <title> tag defines the title of the content on the web page. It is required in an HTML document to display a title for the page in search-engine results.
The title of the content should be placed between the <title>…</title> tags. This title is used inside the head tag.
There should be one <title> element in an HTML document. If we write more than one title for the content the first title tag is considered as a title.
Following is the syntax for the <title tag>.
<title> Title of the content </title>
Following is the example program for the title of the web document.
<!DOCTYPE html> <html> <head> <title>HTML Articles</title> </head> <body> </body> </html>
Following is the output of the title tag, the title is displayed on the top of the browser window.
Following is another example program for the title of the web document.
<!DOCTYPE html> <html> <head> <title>Look at the browser tab...</title> </head> </html>
Now let’s use two title tags in the HTML document.
Following is the example program with two title tags.
<!DOCTYPE html> <html> <head> <title>HTML Articles</title> <title>HTML tutorial</title> </head> <body> </body> </html>
The first title tag of the HTML is displayed, and the second title tag gets ignored.
Kickstart Your Career
Get certified by completing the courseGet Started