Title tag in HTML
- 24-07-2022
- Trung Minh
- 0 Comments
In this article we will learn the title tag in HTML, this is the tag used to declare the description for the title of the web page.
The title tag is required in all HTML documents, it indicates the title of that HTML document, through which users and search engines can understand the meaning of the current page.
1. What is the title tag in HTML?
True to its meaning, title in English means title, and the browser will display its content at the top of the web page's toolbar.
Particularly for search engines like Google, the content of this tag will be displayed in the search results, through which users can know the meaning of your website.
In short, the title tag has the following functions:
- Defines the title on the browser toolbar.
- Give the page a title when it's added to favorites.
- The title will show representative of the page in the search results.
<title>Nội dung</title>
2. How to use title tag in HTML
Example : Use the title tag to define the title of the HTML file.
<!DOCTYPE html> <html> <head> <title>Học lập trình miễn phí tại freetuts.net</title> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p>Nội dung của file</p> </body> </html>
After running the file, on the toolbar will appear the title you entered.
Attribute of title tag:
- The title tag is supported with Global Attributes in HTML.
Browser support:
- Chrome
- Firefox
- IE
- Safari
- Opera