Alex
Alex

Reputation: 13

How do you change the style of the Title tag in css?

My example:

HTML:

<title>hello</title>

CSS (that I'd like to apply):

title {
    text-transform: uppercase;
}

Output:

<title>HELLO</title>

Any ideas?

Upvotes: 0

Views: 1729

Answers (3)

Swapnil Dalvi
Swapnil Dalvi

Reputation: 1039

You can apply CSS to the element, but not though the style attribute (since it is for "All elements but BASE, BASEFONT, HEAD, HTML, META, PARAM, SCRIPT, STYLE, TITLE").

I'm not aware of any browser that will apply CSS for the rendering of the title in browser tabs or title bars though.

You can, however, do something like:

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

Upvotes: 1

Neirid
Neirid

Reputation: 363

You don't. The title tag is not formatted text. If JavaScript is an option you can use: document.title = document.title.toUpperCase();

Upvotes: 1

Xposedbones
Xposedbones

Reputation: 597

Nothing in the head tag is stylable. if you really can't just add the uppercase in html you could do it in javascript but I highly recommend just typing the string in uppercase.

Upvotes: 0

Related Questions