顯示具有 HTML 標籤的文章。 顯示所有文章
顯示具有 HTML 標籤的文章。 顯示所有文章

2015/04/02

[HTML] 網站在 IE 顯示亂碼問題

有一個很久以前的舊有案子, 當時文件是以 big5 為編碼, 近期重新翻修, 把它全部的編碼變更為 unicode (UTF-8)

今早客戶打電話來問, 怎麼網站文字變一格一格的亂碼?

Oops!!!

即使原本的 head 裡已經註記 utf8 也不能把 IE 導到對的編碼顯示

修正一下 html 裡的編排

1. meta 必須寫在 title 之前, 尤其是編碼的那一段
2. charset 一定要是 UTF-8, 而不能只有填 utf8 (IE 比較笨?!)

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

好啦....編碼事搞定了!!!

2007/04/25

[HTML] Conditional Comments

When dealing with HTML and CSS, the most difficult part is to get everything work in different browsers.

Some hack tips:
In CSS, the way I use to code for different browsers (usually IE and FF) is '!important'.
However, it seems that IE 7 understands this magic command while IE 6 doesn't. It makes more difficult to recognize IE 7 and FF.

Here is the solution: Conditional Comments
simple way to check IE version
<!--[if IE 6]>

Using Internet Explorer 6.

<![endif]-->
or check the condition: [if !IE] => for FF

2006/11/28

[HTML] favicon 使用

Site icon
<link rel="icon" type="image/ico" href="favicon.ico" /> (*.ico)
<link rel="icon" type="image/gif" href="icon.gif" /> (*.gif)

WebPage shortcut
<link rel="shortcut icon" href="http://domain/favicon.ico" />

WebPage bookmark
<link rel="bookmark icon" href="http://domain/favicon.ico" />