Mayeenul Islam
Mayeenul Islam

Reputation: 4762

Is there any valid way to do CSS for <title> tag?

I'm developing a site with Bānglā title, and the site title is also in Bānglā. The embedded Bānglā fonts are working on-site (<body>), except the <title>. It's showing scrambled texts. If I can put some CSS to work on the <title> it'd be surely OK.

I tried:

head title{
  font-family: 'Bangla Font','English Font',serif;
  font-weight: bold;
}

But nothing happened. I did the second property to take the effect, if that actually affect. But nothing...

EDIT

After the comments, yap, my <head> is echoing charset=UTF-8, it's a WordPress site. The browser was FireFox. The same FireFox in my home, where the browser settings are set for Bengali scripts with UTF-8, it's OK. But in my office PC, it's not working - I din't check the browser's Bengali scripts settings there, but probably that's set too. Using FF 20.0 at home PC, and [if I recall correctly] FF 25.0 in office PC.

Upvotes: 0

Views: 182

Answers (2)

CodeFanatic
CodeFanatic

Reputation: 11474

Unfortunately, the title is shown in the browser title bar and NOT on the page where styles get applied, so even if you set style on title tag, it wont have any effect on the title shown in the browser title bar

Upvotes: 1

nkmol
nkmol

Reputation: 8091

As @code-zoop said: You should set your charset to utf8

You can do this with a meta element:

<META http-equiv="Content-Type" content="text/html; charset=utf8">

Place that anywhere in your webpage(preferable in the header) and your title should be rendered normally.


As for the css for your title, no that's not possible.

"The TITLE element is not considered part of the flow of text"
Thus not support the css markup. You can use HTML enitities in your title for decoration.

Source : http://www.w3.org/TR/html401/struct/global.html#h-7.4.2

Upvotes: 3

Related Questions