HTML title Tag

HTML title Tag

HTML <title> Tag

The <title> tag in HTML sets the title of a webpage, which appears in the browser tab and search engine results. It is placed inside the <head> section of an HTML document.

1. Basic Syntax

<!DOCTYPE html> <html> <head> <title>My Awesome Website</title> </head> <body> <h1>Welcome to My Website</h1> </body> </html>

Displays "My Awesome Website" in the browser tab.

2. Where <title> Appears

  • Browser Tab: The text inside <title> appears in the browser's title bar or tab.

  • Search Engine Results: Search engines use the <title> as the clickable blue link in search results.

  • Bookmarks & Social Media: When a page is bookmarked or shared, the <title> is shown.

3. Best Practices for <title>

Keep it concise: 50-60 characters for better SEO.
Make it relevant: Reflect the page’s content.
Use keywords naturally: This helps with search ranking.
Avoid duplicate titles: Each page should have a unique <title>.

4. Example for SEO Optimization

<title>Best Laptops for Students in 2025 | Tech Reviews</title>

Optimized for search engines by including keywords like "Best Laptops" and "2025".

5. Dynamic Titles with JavaScript

You can change the <title> dynamically using JavaScript:

<script> document.title = "New Dynamic Title"; </script>

Updates the title without reloading the page.

6. Conclusion

  • The <title> tag defines the webpage title and appears in browser tabs & search results.

  • It is important for SEO & user experience.

  • Use JavaScript to dynamically change the title.

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close