我有一個固定的HTML結構,其中我想在「類別」類一套大膽首先標籤使用CSS
設置粗體只有第一個HREF,標籤在我的示例代碼中,我喜歡到SEHT此鏈接大膽:
- 的Zum Kleben
- 的Zum Heften
- 的Zum Auf- &Abhängen
這裏是我的html代碼:
<div class="content-box-main-inner clearfix">
<div class="categories">
<div class="cat_icon">
<a href="/zum-kleben/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Zum Kleben" title="Zum Kleben"></a>
</div>
<div class="cat_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/zum-kleben/" class="cat-menu">Zum Kleben</a>
</div>
<div class="cat_icon">
<a href="/zum-kleben/Knoepfe-Klebehaken/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Klebehaken" title="Klebehaken"></a>
</div>
<div class="cat_sub_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/zum-kleben/Knoepfe-Klebehaken/" class="cat-menu">Klebehaken</a> </div>
</div>
<div class="cat_icon">
<a href="/zum-kleben/Klebehacken--Sicherheitsfaden--Kombipack/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Klebehacken & Sicherheitsfaden (Kombipack)" title="Klebehacken & Sicherheitsfaden (Kombipack)"></a>
</div>
<div class="cat_sub_link" style="padding-left:8px;">
<div class="cat_link_container"><a href="/zum-kleben/Klettbaender/" class="cat-menu">Klettbänder selbstklebend</a>
</div>
</div>
</div>
</div>
<div class="categories">
<div class="cat_icon">
<a href="/Zum-Heften/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Zum Heften" title="Zum Heften"></a>
</div>
<div class="cat_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/Zum-Heften/" class="cat-menu">Zum Heften</a>
</div>
<div class="cat_icon">
<a href="/Zum-Heften/Pistolen/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Heftpistolen/Etikettierpistolen" title="Heftpistolen/Etikettierpistolen"></a>
</div>
<div class="cat_sub_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/Zum-Heften/Pistolen/" class="cat-menu">Heftpistolen/Etikettierpistolen</a></div>
</div>
</div>
</div>
<div class="categories">
<div class="cat_icon">
<a href="/zum-auf-und-abhaengen/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Zum Auf- & Abhängen" title="Zum Auf- & Abhängen"></a>
</div>
<div class="cat_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/zum-auf-und-abhaengen/" class="cat-menu">Zum Auf- & Abhängen</a>
</div>
<div class="cat_icon">
<a href="/zum-auf-und-abhaengen/Haken/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Haken" title="Haken"></a>
</div>
<div class="cat_sub_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/zum-auf-und-abhaengen/Haken/" class="cat-menu">Haken</a>
</div>
</div>
<div class="cat_icon">
<a href="/zum-auf-und-abhaengen/Faeden/">
<img src="images/logos/item_ltr.gif" width="5" height="13" alt="Sicherheitsfäden & Kabelbinder" title="Sicherheitsfäden & Kabelbinder"></a>
</div>
<div class="cat_sub_link" style="padding-left:8px;">
<div class="cat_link_container">
<a href="/zum-auf-und-abhaengen/Faeden/" class="cat-menu">Sicherheitsfäden & Kabelbinder</a>
</div>
</div>
</div>
</div>
這裏是我的CSS代碼(不工作:():
.catetories.cat_icon:first-child a{
font-weight:bold;
}
這是我JSFIDDLE示例代碼。
希望有人有一個想法。
有你的CSS選擇一個錯字:'.catetories'應該是'categories' –
如果你設置字體粗細貓菜單,應使連接大膽作爲鏈接文字由類「貓菜單」錨定設置 – Dreamweaver