-1

同じDIVタグ全体でフォントの色の装飾を変更するのに問題があります。

私がやりたいのは、私のサイトの特定のページでブレッドクラムタイプのナビゲーションを作成することです。メンテナンスを容易にするために、使用する量またはDivを最小限に抑えたいと思います。

これが私が持っていることとやりたいことです。

 <div id="product-breadcrumbs">
 <div id="breadcrumbs">(Link and color) //   (another link and another color) 
 </div>
 </div>  

CSS

 #product-breadcrumbs {
position: absolute;
left: 0px;
top: 66px;
width: 1024px;
height: 34px;
background-color: #E7E5F2;
 }

 #breadcrumbs {
position: relative;
padding-top: 7px;
padding-bottom: 7px;
text-align: left;
text-indent: 140px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #09C;
text-decoration: none;
 }
4

1 に答える 1

2

編集:あなたの質問を読み直してください(あなたは正しいです、私はそれを読み違えました)。リンクにクラスを与えることでこれを達成できますよね?

 <div id="product-breadcrumbs">
      <div id="breadcrumbs">
           <a href="#" class="colorOne">A link</a>
           <a href="#" class="colorTwo">Another link</a> 
      </div>
 </div>

次の CSS を使用します。

 #breadcrumbs a.colorOne {
      color: black;
 }
 #breadcrumbs a.colorTwo {
      color: blue;
 }
于 2013-03-18T21:08:45.747 に答える