天天看點

如何做成面包屑導航

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>無标題文檔</title>

<style>

#crumbs ul li {

float: left;    

list-style: none;

}

#crumbs ul li a {

display: block;

float: left;

height: 34px;

background: #f66fa2;

text-align: center;

padding: 10px 20px 0 45px;

position: relative;

margin: 0 10px 0 0;

font-size: 20px;

text-decoration: none;  

color: #fff;

}

#crumbs ul li a:after {  

content: "";      

border-top: 22px solid transparent;    

border-bottom: 22px solid transparent;  

border-left: 22px solid #f66fa2;    

position: absolute; right: -22px; top: 0;

z-index: 1;

}

#crumbs ul li a:before {  

content: "";

border-top: 22px solid transparent;

border-bottom: 22px solid transparent;

border-left: 22px solid #fff;

position: absolute; left: 0; top: 0;

}

#crumbs ul li:first-child a {

border-top-left-radius: 5px;  

border-bottom-left-radius: 5px;

padding-left: 40px;

}

#crumbs ul li:first-child a:before {

display: none;

}

#crumbs ul li:last-child a {

padding-right: 30px;

border-top-right-radius: 5px;

border-bottom-right-radius: 5px;

}

#crumbs ul li:last-child a:after {

display: none;

}

#crumbs ul li a:hover {

background: #e56592;

transition: all 0.2s ease;

}

#crumbs ul li a:hover:after {

border-left-color: #e56592;

transition: all 0.2s ease;

}

.fixed {

clear: both;

}

</style>

</head>

<body>

<div id="crumbs">

<ul>

 <li><a href="#" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >首頁</a></li>

 <li><a href="#" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >目錄</a></li>

 <li><a href="#" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" >子目錄</a></li>

</ul>

<div class="fixed"></div>

</div>

</body>

</html>

效果圖:

如何做成面包屑導航

繼續閱讀