アプリ版:「スタンプのみでお礼する」機能のリリースについて

全体にこちらを指定してまして

a { text-decoration: none; color: #0099ff; }
a:hover { text-decoration: none; color: pink; }

一部だけ緑色にしたいのですが

.green a { text-decoration: none; color: green; }
.green a:hover { text-decoration: none; color: black; }

<a href="http://www.google.co.jp" class="green">Google</a>

こうすると変わりません。。。

どなたかご存知でしょうか?

A 回答 (2件)

ある程度の範囲を対象にするなら#1さんの回答のように


class付きの要素で加工と便利。

質問のようにアンカーにclassを付けて区別するなら
a.green {~}
a.green:hover {~}
と、します。
    • good
    • 1
この回答へのお礼

うまくいきました。 知ってみると簡単ですね!
ありがとうございました!!

お礼日時:2006/09/02 21:08

<span class="green">


<a href="">xxx</a>
</span>

.green a { text-decoration: none; color: green; }
これの意味は
greenというclassが設定されたタグの中にある a のスタイル
ってな感じの意味になるかと
    • good
    • 0
この回答へのお礼

.green a と a .green が違うとは勉強になりました。
ありがとうございます!!

お礼日時:2006/09/02 21:09

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