DEV Community

Cover image for HTML tags | title
Carlos Espada
Carlos Espada

Posted on • Edited on

1

HTML tags | title

It is used to define the title of the document. It always goes inside <head>.

It can only contain text, any label inside it will be ignored.

It is a mandatory and unique element, you cannot have more than one <title> in an HTML document.

Is used for:

  • Show in title bar or browser tab.
  • Provide a title to the page when it is added to favorites.
  • Show a title for the page in search engine results.

Title content is very important for SEO, as it is one of the components used by search algorithms to decide in what order the page will appear.

Some tips for writing good titles:

  • It is better to be long and descriptive than short and generic (avoid titles of 1 or 2 words).
  • Search engines usually show only the first 50-60 characters, so the length should not exceed that amount. If you have to, it is a good idea to make sure that the important information in the title is at the beginning and that no important content falls within the part that can be hidden.
  • Don't use keyword lists, as it can lower your search results.
  • Try to be as accurate and meaningful as possible.
  • Try to be as unique as possible within the site itself. Duplicate or near-duplicate titles can contribute to inaccurate search results.

A very common navigation technique for assistive technology users is to first read the <title> and deduce the content of the page from there, since determining it from directly navigating the page is time consuming and can be confusing. Hence, providing a title that is descriptive of the purpose of the page is so important to these users.

The <title> has to be updated to reflect significant changes in the state of a page, for example when there are problems with the validation of a form.

  • Type: none
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay