0

Internet Explorer に問題があります。手を上げてサポートしたくないと言いたいのですが、それは選択肢ではありません. 基本的に、ナビゲーションに使用する順序なしリストを作成しました。次に、別のセクションで、別の親を使用して、別の順序付けられていないリストを使用しましたが、別の ID からプロパティを継承しています。他のすべてのブラウザでは完全に正常に動作します。ページの重要な部分を取り除いて、以下に掲載しています。さらに、w3c css バリデーターを確認したところ、「#container と #stripes ul a:link の 2 つのコンテキストで color と background-color の色が同じ」という警告が表示されました。

箇条書きのリストをクリックすると、ナビゲーションのようにスタイルが設定されることがわかります。しかし、箇条書きを変更しようとすると、ナビゲーションに影響します! メインコンテンツですべての属性を設定しようとしましたが、すべてがシャットダウンします。

誰かがこれをチェックして助けてくれますか? それは私をバティに駆り立てるようなものです!

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2012 Summer Blood Challenge</title>
<style  type="text/css">

#stripes ul
{ font-size:13px;
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;

}
#stripes li
{
float:left; 
}
#stripes ul a:link,a:visited
{
display:block;
width:128px;
font-weight:bold;
color:#FFFFFF; background-image:url(https://trigger.lwcdirect.com/LWC_00486/uploadImages/2012sbc/redbar.jpg);
 background-position: bottom;
text-align:center;
padding:4px;
text-decoration:none;
height:32px;
}
#stripes ul a:hover,a:active
{
background-image:url(https://trigger.lwcdirect.com/LWC_00486/uploadImages/2012sbc/darkredbar.jpg);
}

.roundside {
    background-image: url(https://trigger.lwcdirect.com/LWC_00486/uploadImages/2012sbc/goldboxes_02.jpg);
    background-repeat: repeat-y;
    width: 560px;
    text-align: left;
    padding: 0 30px 0 30px;
}

.roundside ul {list-style-type: none;
    margin: 0;
    padding: 0;}

.roundside li {background-image:url(https://trigger.lwcdirect.com/LWC_00486/uploadImages/2012sbc/drop.gif);

    background-repeat:no-repeat;
    padding:0 0 5px 16px; font-size:16px;}

.roundside ul a:link,a:visited,a:hover,a:active {color:#990000; font-weight:bold}


</style>
</head>
<body class="oneColFixCtrHdr">
<div id="largecontainer"><!--set centering-->
        <div id="container"><!--creates box-->
            <div id="stripes">

            <center>
            <ul>
                <li><a href="#">Promotional Materials</a></li>
                <li><a href="#" style="font-size:11px">Participating Employers and Results</a></li> 
                <li><a href="#">Newsletters</a></li>
                <li><a href="#">Give Blood</a></li>
                <li><a href="#">Become a Member</a></li>
            </ul>
            </center>

            </div><!--end stripes-->
            <div id="mainContent">
                    <div class="roundside">
                    <ul>
                        <li><a href="#">Official Rules and Point Structure</a></li>
                        <li><a href="#">Gage Flyer 8.5x11</a></li>
                        <li><a href="#">2012 SBC Hero Card</a></li>
                    </ul>
                 </div>
            </div> <!-- end #mainContent -->
            <div id="footer">&nbsp;
            </div><!-- end #footer -->
        </div><!--end container-->
    </div><!-- end #largecontainer -->
</body>
</html>
4

1 に答える 1

7

あなたの2番目ul.roundsideからcssを拾っている#stripes ul理由は、次のcssのためです

#stripes ul a:link,a:visited

に変更する必要があります

#stripes ul a:link, #stripes ul a:visited

そうしないと、その後に宣言されたスタイルがa:visited#stripes ul

これは、#stripes ul a:hover,a:active変更する必要がある場合にも#stripes ul a:hover, #stripes ul a:hover a:active当てはまります。そうしないと、同じ問題が発生します。

うまくいけば、これで問題が解決します。

編集:MrSlayerは、私が見逃した以下のコメントで良い点を指摘しました.

あなたも変えたほうがいいです

.roundside ul a:link,a:visited,a:hover,a:active {color:#990000; font-weight:bold}

.roundside ul a:link, .roundside ul a:visited, .roundside ul a:hover, .roundside ul a:active {color:#990000; font-weight:bold}

a将来的に厄介な関連する驚きを避けるために。CSS では、スタイルを設定するときにできるだけ具体的にする必要があります

于 2012-05-07T18:01:54.203 に答える