文章出處
文章列表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> a { text-decoration: none; color: black; } .breadcrumb{ display: inline-block; overflow: hidden; border-radius: 5px; font-size: 1.1em; text-align: center; } .breadcrumb a { /* border: 1px solid;*/ display: block; line-height: 36px; background-color: paleturquoise; position: relative; float: left; padding: 10px 50px 10px 70px ; } /*實現導航的三角圖形*/ .breadcrumb a:after { content: ""; position: absolute; z-index: 1; top:10px; right: -18px;/*讓畫出的正方形位于每個導航右邊border的中間*/ width: 36px; height: 36px; background: paleturquoise; transform: scale(1.15) rotate(45deg);/*讓畫出的正方形翻轉45度,模擬出最后出現的三角效果*/ box-shadow:5px -5px 0 4px rgba(255, 255, 255, 1); /*box-shadow: h-shadow v-shadow blur spread color inset;實現各個導航中間的白色效果 注意:x軸和y軸的值要比陰影的值大。 */ } .breadcrumb a:last-child:after { content: none; } .breadcrumb a:hover, .breadcrumb a:hover:after{ background-color:skyblue; } </style> </head> <body> <div class="breadcrumb"> <a href="#">home</a> <a href="#">goods</a> <a href="#">order</a> <a href="#">more</a> </div> </body> </html>
文章列表
全站熱搜