• ベストアンサー

docomoだとCDATAなどが表示される!

携帯向けにCSSを使っており、 リンクテキストの色をつけようとしております。 以下のサイトを参考にしているのですが、 http://plaza.rakuten.co.jp/yamamoto2/diary/200705130000/ auやSOFTBANKではリンクのテキスト色のCSSが効いているのですが、 docomoではリンクテキストの色が効きません。 <?xml version="1.0" encoding="shift_JIS"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang="ja" lang="ja"> <head> <meta http-equiv="content-type" content="text/html; charset=shift_jis"> <meta name="copyright" content="(C) Honda Motor Co.,Ltd."> <style type="text/css"><!-- <![CDATA[ a:link{color: #4C5872;} a:visited{color: #4C5872;} a:focus{color: #4C5872;} ]] --></style> 上記の a:link{color: #4C5872;} a:visited{color: #4C5872;} a:focus{color: #4C5872;} がdocomoで表示されます。 docomoでリンクの色が変わらないのは目をつぶるとして、 コメント部分が表示されないようにしたいのですが。 どうすればよいのでしょうか?

  • HTML
  • 回答数3
  • ありがとう数2

質問者が選んだベストアンサー

  • ベストアンサー
noname#100277
noname#100277
回答No.3

<style type="text/css"> <![CDATA[ a:link{color: #4C5872;} a:visited{color: #4C5872;} a:focus{color: #4C5872;} ]]> </style> こう記述すべきです。 そして<style type="text/css">より前に以下のコードを埋め込む。 <meta http-equiv="content-style-type" content="text/css" /> XHTMLなのだから空要素には必ず最後は半角を空けて「/」で括る。

panperth
質問者

お礼

最後の二行によって解決しました。 ありがとうございました!

その他の回答 (2)

noname#83877
noname#83877
回答No.2

むしろ > が無いのですか。 xhtmlは <!-- --> のコメントアウトが使えません。 代わりに <![CDATA[  ]]> がコメントアウトになります。

noname#83877
noname#83877
回答No.1

--> は > じゃないですか?

関連するQ&A

  • CSSのチェックをお願いします。

    <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> <head> <meta name="robots" content="noindex,nofollow,noarchive" /> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> .r { color : #407133;} .t { color : #454580;} p { color : #222222;} body { background-color:#e0ffe0;} a:link { color : #0000ff;} a:visited { color : #003333;} a:hover { color : #660000;} a:active { color:#660066;} 1.改行に何か意味はあるのでしょうか? 2.記述の順番や付け足し、削除すべき項目がありましたら、お願いいたします。

    • ベストアンサー
    • HTML
  • CSSのアドバイスをお願いいたします。

    <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> <head> <meta name="robots" content="noindex,nofollow,noarchive" /> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> .r { color : #407133; } .k { color : #336070; } .t { color : #454580; } .s { color : olive; } p { color : #222222; } body { background-color:#e0ffe0; } a:link { color : #0000ff; } a:visited { color : #003333; } a:hover { color : #660000; } a:active { color:#660066; </style> <meta http-equiv="Content-Script-Type" content="text/javascript" />の1行を加えてみました。 この場合の記述の是非。 また記述すべき個所は合っているのでしょうか。

    • ベストアンサー
    • HTML
  • 作成したホームページがIEでは表示されない

    xhtmlとcssでページを作成しました。 FireFoxではローカルでもネットにアップした状態でも見ることが出来るのですが、 IEを使用すると、ローカルでは見れるのですが、ネットに上げたものは指定した背景の色しか表示されません。 何が原因なんでしょうか。 よろしくお願いします。 <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html;charset=Shift_JIS" /> <title></title> <link rel="stylesheet" href="style.css" type="text/css"> </head>

  • CSS 記事内link色変更方法

    当方全くの素人なんですが、現在のブログで共有テンプレートを使用しています。 CSSで記事内だけのリンク、又はタグの色を変更したいのですが、 下記の部分をさわっても、記事内だけでなく、すべてのリンクに反映されてしまい困っています… いろいろインターネット上で書かれている事にはトライしてみたのですが、 全然できません。 「スタイルシートの末尾にこれこれを入力してください」などもやってみましたが、無理です。 自分はここが末尾だと思っているけど、実はそこが末尾ではないのかもしれません… どなたか、どこにどのように入力すれば良いのか、わかりやすくおしえていただけないでしょうか?! よろしくお願いします。 PS・リンク・タグの希望色は    ALINK 青     AVISITED 紫    AHOVERとAACTIVEは灰色希望です。 /* Hyper text ------------------------------------------------- */ a { text-decoration: none; /*\*/ overflow: hidden; /* for Fx */ /**/} a:link { color: #0000ff; ext-decoration: none;} a:visited {color: #cc0099; text-decoration: none;} a:focus, a:hover, a:active {color: #3399cc; text-decoration: none;} h1 a:link, h1 a:visited, .entry_header a:link, .entry_header a:visited {color: #603813; text-decoration: none;} h1 a:focus, h1 a:hover, h1 a:active, .entry_header a:focus, .entry_header a:hover, .entry_header a:active {color: #603813; text-decoration: underline;}

    • ベストアンサー
    • CSS
  • 携帯サイトでのcssトラブル

    携帯サイトを作っています。 xhtmlの宣言を↓の通りにしております。 <?xml version="1.0" encoding="Shift_JIS" ?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> リンクなどは、cssを使ってサイトを作っており、3キャリアのエミュレーターでは問題なく表示されています。 しかし、本の通りに作っているのですが、自分の携帯(docomo SH-03A)ではまったくcssが機能しません。 以下に、主に使っているタグなどについて書いていきます。何かおかしいところがあれば教えてください。 内部参照リンク <style type="text/css"> <!-- a, a:link {color:#ff0000;} a:visited {color:#ff0000;} a:active {color:#ffffff;} a:hover {color:#663399;} --> </style> ボディスタイル <body style="background-color:#ccccff;color:#000000;"> <div>タグ <div style="text-aling:center;background-color:#000099;font-size:medium; color:#ffffff;" align="center">○○○○</div> ↑でだめだったので、↓のように<span>にはさんでみたがだめでした。 <div align="center"><span style="text-aling:center;background-color:#000099;font-size:medium; color:#ffffff;">○○○○</span></div> 非常に困っています。なにとぞよろしくお願いします。

    • ベストアンサー
    • HTML
  • 外部から読み込んだCSSとヘッダに書いたCSSでフォントサイズの表示が変わってしまう

    Win IE6にて、外部から読み込んだCSSとヘッダに書いたCSSでフォントサイズの表示が変わってしまいます。 下のようにヘッダに書いた場合のフォントサイズが、 外部CSSにのみ同じように書いた場合に比べて小さくなります。 --------------------------------------------------------------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>テスト</title> <link href="test.css" rel="stylesheet" type="text/css" media="all" /> <style type="text/css" media="all"> <!-- #a .b { font: 70% "MS Pゴシック", Osaka; color: #333333; } --> </style> </head> <body> <div id="a"> <div class="b">表示のテストです</div> </div> </body> </html> ----------------------------------------------------- 外部CSSに書いた場合でも小さく表示させるようにするには どうしたらいいでしょうか? また、小さくなる原因はわかりましたらご教授願います。

    • ベストアンサー
    • HTML
  • FireFoxのテキスト表示について

    フレーム、javascript、スタイルシート、cssファイル使いまくりなサイトですが、 FireFoxで表示すると、テキストにカーソルを置いた時に、 リンク時の状態になってしまいます。 具体的には、文字色が変わり、下線が表示されます。 これは、どうすれば解消できるでしょうか。 ちなみに、リンクの設定は下記の通りです。 リンク(訪問前)の指定 a:link{ color:#444444; text-decoration:none; } リンク(訪問済み)の指定 a:visited{ color:#444444; text-decoration:none; } リンク(カーソルを乗せた時)の指定 a:hover{ color:#c0c0c0; text-decoration:underline; } 良い解決方法がありましたら、よろしくお願いします。

  • xhtmlのスタイルシートについて

    <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> <head> <meta name="robots" content="noindex,nofollow,noarchive" /> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> t { color : 407133; k { color : 337060; r { coior : 454580 &gt; </style> ↑どこか間違っているところがありましたら教えてください。 <span class="#407133">てすと</span> 文字色が変わりません。 どなたか指摘願います。

  • 携帯サイトでソフトバンクだけ接続されない

    携帯サイトを作っています。各キャリアのエミュレーター、firefoxのアドオン「FireMobieSimulator」では問題なく表示されるのですが、ソフトバンクの実機ではなぜか接続されません。機種によっては「お客様の端末からは接続できません」というようなエラーメッセージが出ます。 最初は、絵文字変換スプリクトのせいかと思い、それを削除した状態でアップロードしてもつながりません。 ソースは下記のようになっています。 何か問題がありましたら、教えていただければと思います。 <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml ; charset=Shift_JIS" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pragma" content"no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <meta name='robots' content="all"> <meta name='description' content=""> <meta name="keywords" content=""> <style type="text/css"> <!-- a, a:link {color:#000099;} a:visited {color:#000099;} a:active {color:#ffffff;} a:hover {color:#663399;} --> </style> <title>test</title> </head> <body> </body> </html>

    • ベストアンサー
    • HTML
  • fc2ブログでリンクテキストの色が設定できない

    テンプレート名 Penetration です。テキストリンクの色を変更するためにcssを編集しましたが、記事内のテキストリンクに反映されません。 変更箇所は↓ /* ハイパーテキスト ------------------------------------------------- */ a { overflow: hidden; /* for Fx */ } a:link { color: #8bc9d7; text-decoration: none; } a:visited { color: #8bc9d7; } a:focus, a:hover { text-decoration: none; } a:active { } ↑上記箇所を、 /* ハイパーテキスト ------------------------------------------------- */ a { overflow: hidden; /* for Fx */ } a:link { color: #6699FF; text-decoration: none; } a:visited { color: #6699FF; text-decoration: none; } a:focus, a:hover { color: #FF9900; text-decoration: none; } a:active { } ↑に書き換えました。 記事タイトル・カレンダー・カテゴリ・コメント・トラックバックは希望通り、テキストリンク→水色  カーソルを重ねると→黄色になりましたが、記事内のテキストには反映されません。 ※訪問済みもアクティブも水色のままで良いので記述しなくてもいい気がしますが、原因が分からなくなりそうで、今のところ消していません。 cssを触りだして10日程度の初心者です。ご指導宜しくお願いします。

専門家に質問してみよう