Can we set the style to the title tag in the title

Is it possible to set the style for the header in the html header header as follows. I tried, it didn’t work.

<title style="font-style:italic;"> My Title</title> 
+7
source share
6 answers

You can apply CSS to the <title> element, but not to the style attribute (since it is intended for all elements except BASE, BASEFONT, HEAD, HTML, META, PARAM, SCRIPT, STYLE, TITLE ").

I don’t know a single browser that will use CSS to render the title in browser tabs or in headers.

You can, however, do something like:

 head { display: block; } title { display: block; font-size: 200%; font-weight: bold; } 
+9
source

Nope. How the title is made depends on the browser.

+2
source

Unfortunately, the title is displayed in the title bar of the browser, and NOT on the page where the styles are applied, so the event, if you set the style in the title tag, has no effect

+1
source

You cannot create a title tag ( <title> ).

0
source

Try this CSS rule:

 * {display:block} 

In the Chrome browser, this makes the title (and script !) Elements visible on the page. But I don’t think you want it. Usually we use h1 .. h6 for headings that should be visible on the page itself.

0
source

I'm not sure how, but it can be done: Chrome, Waterfox and Firefox:

Styled Text Header Attribute

og: name on twitter

0
source

Source: https://habr.com/ru/post/892484/


All Articles