0
1

HTML文書のタイトルの左横書き・右横書き

Posted at

HTML文書のタイトルが左横書きで表示されるか右横書きで表示されるかはUnicodeのBIDIアルゴリズムによって決定される(title要素のdirectionプロパティの値などには依存しない)。そのため、ついうっかりタイトルの1文字目をアラビア文字にするとタイトルは右横書きで表示されてしまう。たとえばtitle要素を

<title>كَتَبَ | Fooctionary</title>

と書くと次のように表示される(Microsoft Edgeの場合)。

html-document-title-example-bad.png

タイトルの文字の進行方向を正しく表示するためにはUnicodeの方向制御コードを使う。たいていの場合はタイトルの頭にleft-to-right markを付け加えるだけでよい。

<title>&lrm;كَتَبَ | Fooctionary</title>

html-document-title-example-good.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1