これ何て呼びますか

terapadでhtmlとCSSを書いてます。5本のhtmlファイルに共通するCSSはちゃんとlIEに反映されるのですが、個別のhtmlファイルに関するCSSが反映されません。IEの問題かと思うのですが、どうすれば解決できるのでしょうか?

A 回答 (4件)

テスト用簡単なサンプル


★タブは_に置換してあるので戻す。
[HTML4.01strict]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
_<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
_<title>サンプル</title>
_<meta name="author" content="ORUKA1951">
_<meta http-equiv="Content-Style-Type" content="text/css">
_<link rev="made" href="mailto:oruka1951@hoge.com" title="send a mail" >
_<link rel="START" href="../index.html">
<!-- 永続的スタイルシート -->
_<link rel="stylesheet" type="text/css" href="./styleSheet5/persistent.css">
<!-- 優先スタイルシート -->
_<link rel="stylesheet" type="text/css" media="screen" href="./styleSheet5/outline.css" title="優先スタイル">
_<link rel="stylesheet" type="text/css" media="screen" href="./styleSheet5/color.css" title="優先スタイル">
<!-- 代替スタイルシート -->
_<link rel="Alternate StyleSheet" type="text/css" media="screen" href="./styleSheet5/alternate.css" title="反転">
<!-- このページ専用 -->
_<link rel="StyleSheet" type="text/css" media="screen" href="./styleSheet5/page1.css" title="優先スタイル">
<!-- 印刷用 -->
_<link rel="styleSheet" type="text/css" media="print" href="./styleSheet5/print.css">
</head>
<body>
_<div class="header">
__<h1>タイトル</h1>
__<p>このページでは・・・・</p>
_</div>
_<div class="section">
__<h2>見出し</h2>
__<p>
___terapadでhtmlとCSSを書いてます。5本のhtmlファイルに共通するCSSはちゃんとlIEに反映されるのですが、個別のhtmlファイルに関するCSSが反映されません。IEの問題かと思うのですが、どうすれば解決できるのでしょうか?
__</p>
__<div class="nav">
___<ol>
____<li><a href="/">Top</a></li>
____<li><a href="/sample/page1">Page1</a></li>
____<li><a href=".sample/page2">Page2</a></li>
___</ol>
__</div>
_</div>
_<div class="footer">
__<h2>文書情報</h2>
__<dl class="documentHistry">
___<dt id="FIRST-PUBLISHED">First Published</dt>
___<dd>2013-12-20</dd>
___<dt id="LAST-MODIFIED">Last Modified</dt>
___<dd>2013-12-29 12:00:00 (JST)</dd>
__</dl>
__<address>&copy; ORUKA1951 2012 - 2016 All Rights Reserved mailto:*****</address>
_</div>
</body>
</html>

[outline.css]
@charset "Shift_JIS";
div.header,div.section,div.footer{width:80%;min-width:620px;max-width:900px;margin:0 auto;padding:5px;}
div.section{position:relative;min-height:400px;}
div.section h2,div.section p{margin-right:21%;}
div.section div.nav{position:absolute;right:0;top:0;height:100%;width:20%;}

[persistent.css]
@charset "Shift_JIS";html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6,p{margin:0;line-height:1.8em;}
p{text-indent:1em;}

[color.css]
@charset "Shift_JIS";
body{background-color:silver;}
div.header,div.section,div.footer{background-color:white;}
div.section div.nav{background-color:yellow;}

[alternate.css]
@charset "Shift_JIS";
body{background-color:silver;}
div.header,div.section,div.footer{
background-color:navy;
color:white;
width:90%;min-width:620px;max-width:1000px;margin:0 auto;padding:5px;
}
a:link{color:yellow;}

[page1.css]
@charset "Shift_JIS";
body{background-color:gray;}
div.header,div.section,div.footer{background-color:rgb(220,255,255);}
div.section div.nav{background-color:yellow;}
div.section p{z-index:100;}
div.section p:after{content:"\A このページ専用のスタイルシートが適用されています";white-space:pre;color:red;font-weight:bold;font-size:1.6em;}

[print.css]
@charset "Shift_JIS";
body{width:80%;margin:0 auto;}
a{color:black;text-decoration:none;}
a[href]:after{content:"\A (http://hoge.com"attr(href)")";white-space:pre;}
div.section div.nav:before{content:"サイトマップ\A";font-size:1.6em;font-weight:bold;white-space:pre;}
div.section div.nav{width:80%;margin:20px auto;border:solid 1px gray;}
    • good
    • 0

他のブラウザではちゃんと動作するのですか?


それを、まず確認しないとIEが原因か否かは判断できません。
    • good
    • 0

質問内容がもう一つ不明なのですが、原因はちゃんとリンクされていないことでしょう。


リンク先が正しいなら、その正しいリンク先にCSSを置いていない。
CSSの置き場所が正しいなら、参照先の記述が間違っている。
「abcd,css」などドットがカンマになっていて、CSSとして機能していないという可能性もあり。

この回答への補足

回答ありがとうございます。CSSはちゃんとリンクしていると思うのですが(5本の共通コンテンツはちゃんとCSSを反映している)なぜか個別のCSSが反映されないのです。分かりにくくてすみません。

補足日時:2013/12/21 18:32
    • good
    • 0

・terapadは無関係

    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!