― MozillaZine.jp フォーラムは Mozilla 製品に関する情報交換の場です ―



All times are UTC + 9 hours

新しいトピックを投稿する トピックへ返信する  [ 6 件の記事 ] 
作成者 メッセージ
投稿記事Posted: 2010年8月28日(土) 08:36 
オフライン

登録日時: 2006年11月18日(土) 02:23
記事: 6
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

_________________
Kenji KAMIYA


通報する
ページトップ
 プロフィール  
引用付きで返信する  
投稿記事Posted: 2010年8月29日(日) 17:29 
オフライン
Moderator

登録日時: 2007年7月20日(金) 14:46
記事: 370
実際のソースコードを見ないとコメントしづらい状況だと思います。
ブラウザのバージョンも明記してください。
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) が必須です。
文書型宣言がないと、ブラウザが勝手に解釈して期待通りに表示されなくなります。

_________________
mar


通報する
ページトップ
 プロフィール  
引用付きで返信する  
投稿記事Posted: 2010年8月30日(月) 00:45 
オフライン

登録日時: 2006年11月18日(土) 02:23
記事: 6
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


通報する
ページトップ
 プロフィール  
引用付きで返信する  
投稿記事Posted: 2010年8月30日(月) 02:11 
オフライン

登録日時: 2006年11月18日(土) 02:23
記事: 6
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

_________________
Kenji KAMIYA


通報する
ページトップ
 プロフィール  
引用付きで返信する  
投稿記事Posted: 2010年8月30日(月) 10:40 
オフライン

登録日時: 2005年12月19日(月) 23:05
記事: 105
Kenji Kamiya さんが書きました:
<!-- -------Nav Horizontal by table -------- -->

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


通報する
ページトップ
 プロフィール  
引用付きで返信する  
投稿記事Posted: 2010年9月08日(水) 22:05 
オフライン
Moderator

登録日時: 2005年12月13日(火) 22:41
記事: 304
お住まい: Japan
Sakuraya さんが書きました:
おそらくNavの前にあるハイフンが7個だからです。
以前、どこかでこの問題を解説したページを見た覚えがあります。

たぶんこれのことかと。

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


通報する
ページトップ
 プロフィール  
引用付きで返信する  
期間内表示:  ソート  
新しいトピックを投稿する トピックへ返信する  [ 6 件の記事 ] 

All times are UTC + 9 hours


オンラインデータ

このフォーラムを閲覧中のユーザー: なし & ゲスト[3人]


トピック投稿:  可
返信投稿:  可
記事編集: 不可
記事削除: 不可
ファイル添付: 不可

検索:
ページ移動:  
Powered by MozillaZine.jp® Forum Software © phpBB Group , Almsamim WYSIWYG
Japanese translation principally by ocean