0

作業中のテンプレートのリンクのフォントの色に問題がありました。コードを見てください:

http://www.wendyhenrichs.com/prob/

ヘッダー リンクの色が、ナビゲーション バーのリンクの色と同じであることがわかります。

これらの異なるスタイルをどのように分離できますか?

ありがとう!

4

3 に答える 3

2

main.css ファイルを次のように編集します。

#header h1 {
    color: #000000;  // <-- your new title color
    font-family: 'News Cycle',arial,serif;
    font-size: 6em;
    font-weight: bold;
    letter-spacing: 2px;
    padding-bottom: 5px;
    text-shadow: 1px 1px 1px #CCCCCC;
}

セレクターの下にすべてのリンクがあります。

#nav ul li a, a:link, a:visited {
color: blue;
font-family: 'Smythe',serif;
font-size: 26px;
font-style: normal;
font-weight: 400;
letter-spacing: 0;
line-height: 1.2;
text-decoration: none;
text-shadow: 2px 2px 2px #AAAAAA;
text-transform: none;
word-spacing: 0;
}

#nav ul li a part をa:link、a:visitedから分離し、すべてのリンクではなく nav リンクだけに色を割り当てることもできます。

于 2011-05-04T12:10:43.283 に答える
1

どちらの場合も、CSS は a:link と a:visited を使用します

#nav ul li a, a:link, a:visited {
    color: white;
    font-family: 'Smythe',serif;
    font-size: 26px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.2;
    text-decoration: none;
    text-shadow: 2px 2px 2px #AAAAAA;
    text-transform: none;
    word-spacing: 0;
}

#header h1 a, a:link, a:visited {
    color: #000000;
    text-decoration: none;
}

あなたはそれらを分離することができます

#nav ul li a, #nav ul li a:link, #nav ul li a:visited { // nav link style ... }

#header h1 a, #header h1 a:link, #header h1 a:visited { // header link style... }
于 2011-05-04T12:15:06.227 に答える
0

その理由は、<a>タグに色を付けているからです

#nav ul li a, a:link, a:visited {
    color: white;
    font-family: 'Smythe',serif;
    font-size: 26px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.2;
    text-decoration: none;
    text-shadow: 2px 2px 2px #AAAAAA;
    text-transform: none;
    word-spacing: 0;
}

これを上書きするには、上記のcss書き込み

#header a h1{
color: yellow;
}
于 2011-05-04T12:14:20.020 に答える