EN VI

Css - Why does my title disappear when i use title tags?

2024-03-10 21:30:05
Css - Why does my title disappear when i use title tags?

Im trying to use title tag with Tailwindcss+React and the title itself disappears. If I delete the tag, it’s present.Any thoughts?

I deleted the title tag and write the word into h1 and another tags, and its work

 <div className="text-center">
   <title className="text-[40px] font-medium">{t("news")}</title>
 </div>

Solution:

The <title> HTML tag is only supposed to be used in the <head> element of a HTML web page to define the webpage's title that appears in the tab of the browser. It is not meant for presentational display in the page.

If you are looking to mark-up a title or heading, consider using a <h1> to <h6> tag that is most appropriate for your context.

You can read more about <title> in the MDN documentation and also the <h1> to <h6> elements.

Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login