麵包屑導航條
阿新 • • 發佈:2018-10-31
麵包屑導航不是按分類進行,而是有一個層級關係。
效果圖如下:
<style type="text/css"> ul {list-style: none;} ul li a { float: left; margin-right: 30px; display: inline-block; position: relative; height: 30px; padding: 10px 20px 0 20px; text-align: center; text-decoration: none; color: #fff; font-size: 20px; background: #3498db; } li a:after { content: ""; border-left: 20px solid #3498db; border-top: 20px solid transparent; border-bottom: 20px solid transparent; position: absolute; right: -20px; top: 0; } li a:before { content: ""; border-left: 20px solid transparent; border-top: 20px solid #3498db; border-bottom: 20px solid #3498db; position: absolute; left: -20px; top: 0; } ul li:first-child a { border-top-left-radius: 10px; border-bottom-left-radius: 10px; } ul li:first-child a:before { display: none; } ul li:last-child a { border-top-right-radius: 10px; border-bottom-right-radius: 10px; } ul li:last-child a:after { display: none; } li a:hover { background: #fa5ba5; } li a:hover:after { border-left-color: #fa5ba5; } li a:hover:before { border-top-color: #fa5ba5; border-bottom-color: #fa5ba5; } </style>
<body> <ul> <li><a href="#">中國</a></li> <li><a href="#">北京</a></li> <li><a href="#">天安門</a></li> <li><a href="#">升旗儀式</a></li> </ul> </body>
demo參考於此連結: 麵包屑導航