The Web page I am implementing looks fine under Mozilla Firefox, Google Chrome and Opera. However, as under MS-IE, the positioning of the 2 (logo and header text) out of the 9 elements are severely off in top-left direction, and the upper half of the 1st line is chopped, I copied and pasted the following declaration according to an advice from a Website consortium.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Although it solved the problem with MS-IE, now the company logo (GIF) and the header slogan (ASCII text) disappeared under Firefox, and the following line (which is one of the comments in my document) showed up in place of them.
<!--------- Nav Horizontal by table ---------->
This doesn't happen with the other browsers --- i.e., MS-IE, Opera and Google Chrome.
Does this <!DOCTYPE...> declaration have some peculiar side effect on Firefox? If so, could you tell me how to get around that? Or, is this merely due to a bug I created in my program?
# 投稿内容から Web 標準フォーラムが妥当と判断してトピックを移動しました。by Moderator Hide
HTML/CSS compatibility issue between MS-IE.
-
Kenji Kamiya
- 記事: 6
- 登録日時: 2006年11月18日(土) 02:23:46
HTML/CSS compatibility issue between MS-IE.
Kenji KAMIYA
Re: HTML/CSS compatibility issue between MS-IE.
実際のソースコードを見ないとコメントしづらい状況だと思います。
ブラウザのバージョンも明記してください。
内側にスペースを一つ入れてみてください。
基本的に、HTML/XHTML には文書型宣言 (DOCTYPE) が必須です。
文書型宣言がないと、ブラウザが勝手に解釈して期待通りに表示されなくなります。
ブラウザのバージョンも明記してください。
正しくは、"<!--" と "-->" で囲みます。Kenji Kamiya さんが書きました:...(snip)... the following line (which is one of the comments in my document) showed up in place of them.
<!--------- Nav Horizontal by table ---------->
内側にスペースを一つ入れてみてください。
コード: 全て選択
<!-- -------Nav Horizontal by table -------- -->Firefox に限らず、どのブラウザでも文書型宣言 (<!DOCTYPE>) の書き方によって、そのソースコードの解釈の仕方が変わります。最初に書いたページがどの DOCTYPE を書いていたのか、それとも書いていなかったのかが分からないと、何とも言えません。Kenji Kamiya さんが書きました:Does this <!DOCTYPE...> declaration have some peculiar side effect on Firefox? If so, could you tell me how to get around that? Or, is this merely due to a bug I created in my program?
基本的に、HTML/XHTML には文書型宣言 (DOCTYPE) が必須です。
文書型宣言がないと、ブラウザが勝手に解釈して期待通りに表示されなくなります。
mar
-
Kenji Kamiya
- 記事: 6
- 登録日時: 2006年11月18日(土) 02:23:46
Re: HTML/CSS compatibility issue between MS-IE.
Hi Mar,
Thanks a lot for your prompt response. Putting a <space> like the following worsen the problem.
<!-- -------Nav Horizontal by table -------- -->
But, I found my problem. The <!DOCTYPE...> declaration in many tutorial examples is expressed in two lines like the following.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I tried to put them in one line --- i.e., I replaced the <CR><LF> by <SPACE> between <!DOCTYPE ... //EN" and "http://www.w3.org/TR ..." --- and the problem is gone.
It's interesting to know that this problem only happens with Firefox. Other browsers have no problem recognizing the 2-line declaration.
Thanks again for your help.
Ken
Thanks a lot for your prompt response. Putting a <space> like the following worsen the problem.
<!-- -------Nav Horizontal by table -------- -->
But, I found my problem. The <!DOCTYPE...> declaration in many tutorial examples is expressed in two lines like the following.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I tried to put them in one line --- i.e., I replaced the <CR><LF> by <SPACE> between <!DOCTYPE ... //EN" and "http://www.w3.org/TR ..." --- and the problem is gone.
It's interesting to know that this problem only happens with Firefox. Other browsers have no problem recognizing the 2-line declaration.
Thanks again for your help.
Ken
Kenji KAMIYA
-
Kenji Kamiya
- 記事: 6
- 登録日時: 2006年11月18日(土) 02:23:46
Re: HTML/CSS compatibility issue between MS-IE.
I mus apologize for making a quick judgement that has turned out to be false, but the behavior is very bizarre.
First, FF CAN recognize the 2-line <!DOCTYPE...>.
When I minimized the message length to 18 characters between "<!--" and "-->", any comment lines did not show up on the FF browser. Addition of even one more character resulted in the comment appearing on the browser. But after a while, no matter how many characters I entered, the problem stopped resurfacing.
I am puzzled. No idea why the problem happened before. I could resurface again.
If some is experiencing a similar problem, please let me know.
Thanks,
Ken
First, FF CAN recognize the 2-line <!DOCTYPE...>.
When I minimized the message length to 18 characters between "<!--" and "-->", any comment lines did not show up on the FF browser. Addition of even one more character resulted in the comment appearing on the browser. But after a while, no matter how many characters I entered, the problem stopped resurfacing.
I am puzzled. No idea why the problem happened before. I could resurface again.
If some is experiencing a similar problem, please let me know.
Thanks,
Ken
Kenji KAMIYA
Re: HTML/CSS compatibility issue between MS-IE.
おそらくNavの前にあるハイフンが7個だからです。Kenji Kamiya さんが書きました:<!-- -------Nav Horizontal by table -------- -->
以前、どこかでこの問題を解説したページを見た覚えがあります。
#申し訳ありませんが詳しくはgoogleしてください。
ハイフンではない、別の記号──=や~などを使うようにすればいいと思います。
Re: HTML/CSS compatibility issue between MS-IE.
たぶんこれのことかと。Sakuraya さんが書きました:おそらくNavの前にあるハイフンが7個だからです。
以前、どこかでこの問題を解説したページを見た覚えがあります。
コメントは正しく書く必要があります(Web標準普及プロジェクト)
http://www.mozilla.gr.jp/standards/webtips0006.html