2017-09-11 65 views
0

問候, 我試圖樣式類別列表放在我不知道我必須這樣搜索&我有引導 wp_list_categories風格這個HTML代碼();風格WP類別清單與引導

<nav class="navbar navbar-expand-lg navbar-dark our-color fixed-top"> 
 
\t \t <div class="container"> <a class="navbar-brand" href="#"> <img src="<?php bloginfo('template_directory'); ?>/images/logo-woocommerce-white.png" width="150" height="30" alt=""> </a> 
 
\t \t \t <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> 
 
\t \t \t <div class="collapse navbar-collapse" id="navbarResponsive"> 
 
\t \t \t \t <ul class="navbar-nav ml-auto s"> 
 
\t \t \t \t \t <li class="nav-item active bold"> <a class="nav-link" href="#">الرئيسية<span class="sr-only">(current)</span> </a> </li> 
 
\t \t \t \t \t <?php wp_list_categories(); ?> 
 
\t \t \t \t \t <li class="nav-item bold"> <a class="nav-link" href="#">خدمات</a> </li> 
 
\t \t \t \t \t <li class="nav-item bold"> <a class="nav-link" href="#">اتصل بنا</a> </li> 
 
\t \t \t \t \t 
 
\t \t \t \t </ul> 
 
\t \t \t </div> 
 
\t \t </div> 
 
\t </nav>

我想導入WP的類別在這一類>的,如果我把它放在一個div它不會影響列表,,什麼我必須這樣做!

回答

0

可以按如下

li{ 
 
list-style-type:none; 
 
padding:10px; 
 
border-radius:4px; 
 
background:black; 
 
margin-bottom:2px; 
 

 
} 
 

 
li a{ 
 
color:#fff; 
 
text-decoration:none; 
 
} 
 

 
li:hover{ 
 
background:red; 
 
transition:all 0.3s; 
 
color:#fff; 
 
}
<nav class="navbar navbar-expand-lg navbar-dark our-color fixed-top"> 
 
\t \t <div class="container"> <a class="navbar-brand" href="#"> <img src="<?php bloginfo('template_directory'); ?>/images/logo-woocommerce-white.png" width="150" height="30" alt=""> </a> 
 
\t \t \t <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> 
 
\t \t \t <div class="collapse navbar-collapse" id="navbarResponsive"> 
 
\t \t \t \t <ul class="navbar-nav ml-auto s"> 
 
\t \t \t \t \t <li class="nav-item active bold"> <a class="nav-link" href="#">الرئيسية<span class="sr-only">(current)</span> </a> </li> 
 
\t \t \t \t \t <?php wp_list_categories(); ?> 
 
\t \t \t \t \t <li class="nav-item bold"> <a class="nav-link" href="#">خدمات</a> </li> 
 
\t \t \t \t \t <li class="nav-item bold"> <a class="nav-link" href="#">اتصل بنا</a> </li> 
 
\t \t \t \t \t 
 
\t \t \t \t </ul> 
 
\t \t \t </div> 
 
\t \t </div> 
 
\t </nav>

希望這會工作作風它。祝一切順利。對於任何查詢請評論

+0

謝謝你把不正確的答案,我想風格由WordPress中的wp_list_categories生成的列表 –