MozillaZine.jp フォーラム
https://forums.mozillazine.jp/

HTML/CSS compatibility issue between MS-IE.
https://forums.mozillazine.jp/viewtopic.php?f=30&t=10583
ページ 11

作成者:  Kenji Kamiya [ 2010年8月28日(土) 08:36 ]
記事の件名:  HTML/CSS compatibility issue between MS-IE.

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

作成者:  mar [ 2010年8月29日(日) 17:29 ]
記事の件名:  Re: HTML/CSS compatibility issue between MS-IE.

実際のソースコードを見ないとコメントしづらい状況だと思います。
ブラウザのバージョンも明記してください。
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 -------- -->


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?

Firefox に限らず、どのブラウザでも文書型宣言 (<!DOCTYPE>) の書き方によって、そのソースコードの解釈の仕方が変わります。最初に書いたページがどの DOCTYPE を書いていたのか、それとも書いていなかったのかが分からないと、何とも言えません。

基本的に、HTML/XHTML には文書型宣言 (DOCTYPE) が必須です。
文書型宣言がないと、ブラウザが勝手に解釈して期待通りに表示されなくなります。

作成者:  Kenji Kamiya [ 2010年8月30日(月) 00:45 ]
記事の件名:  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

作成者:  Kenji Kamiya [ 2010年8月30日(月) 02:11 ]
記事の件名:  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

作成者:  Sakuraya [ 2010年8月30日(月) 10:40 ]
記事の件名:  Re: HTML/CSS compatibility issue between MS-IE.

Kenji Kamiya さんが書きました:
<!-- -------Nav Horizontal by table -------- -->

おそらくNavの前にあるハイフンが7個だからです。
以前、どこかでこの問題を解説したページを見た覚えがあります。
#申し訳ありませんが詳しくはgoogleしてください。
ハイフンではない、別の記号──=や~などを使うようにすればいいと思います。

作成者:  Kuro [ 2010年9月08日(水) 22:05 ]
記事の件名:  Re: HTML/CSS compatibility issue between MS-IE.

Sakuraya さんが書きました:
おそらくNavの前にあるハイフンが7個だからです。
以前、どこかでこの問題を解説したページを見た覚えがあります。

たぶんこれのことかと。

コメントは正しく書く必要があります(Web標準普及プロジェクト)
http://www.mozilla.gr.jp/standards/webtips0006.html

ページ 11 All times are UTC + 9 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/