查看样式

  1. <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
  2. <h1>Flat CSS3 breadcrumb</h1>
  3. <ul id="breadcrumb">
  4. <li><a href="#"><span class="icon icon-home"> </span></a></li>
  5. <li><a href="#"><span class="icon icon-beaker"> </span> Projects</a></li>
  6. <li><a href="#"><span class="icon icon-double-angle-right"></span> Breadcrumb</a></li>
  7. <li><a href="#"><span class="icon icon-rocket"> </span> Getting started</a></li>
  8. <li><a href="#"><span class="icon icon-arrow-down"> </span> Download</a></li>
  9. <li><a href="#"><span class="icon icon-arrow-down"> </span> Download</a></li>
  10. </ul>
  1. @import "compass/css3";
  2. $blue-gray : #34495e;
  3. $blue-gray-darken : #2c3e50;
  4. $blue : #3498db;
  5. $blue-darken : #2980b9;
  6. $green : #1abc9c;
  7. $green-darken : #16a085;
  8. *{
  9. margin: 0;
  10. padding: 0;
  11. @include box-sizing(border-box);
  12. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  13. font-size: 12px;
  14. }
  15. body{
  16. text-align: center;
  17. background-color: $blue-gray;
  18. }
  19. h1{
  20. font-weight:100;
  21. font-size:32px;
  22. padding:40px;
  23. color:#fff;
  24. }
  25. #breadcrumb{
  26. list-style:none;
  27. display: inline-block;
  28. .icon{
  29. font-size: 14px;
  30. }
  31. li{
  32. float:left;
  33. a{
  34. color:#FFF;
  35. display:block;
  36. background: $blue;
  37. text-decoration: none;
  38. position:relative;
  39. height: 40px;
  40. line-height:40px;
  41. padding: 0 10px 0 5px;
  42. text-align: center;
  43. margin-right: 23px;
  44. }
  45. &:nth-child(even){
  46. a{
  47. background-color: $blue-darken;
  48. &:before{
  49. border-color:$blue-darken;
  50. border-left-color:transparent;
  51. }
  52. &:after{
  53. border-left-color:$blue-darken;
  54. }
  55. }
  56. }
  57. &:first-child{
  58. a{
  59. padding-left:15px;
  60. @include border-radius(4px 0 0 4px);
  61. &:before{
  62. border:none;
  63. }
  64. }
  65. }
  66. &:last-child{
  67. a{
  68. padding-right:15px;
  69. @include border-radius(0 4px 4px 0);
  70. &:after{
  71. border:none;
  72. }
  73. }
  74. }
  75. a{
  76. &:before,
  77. &:after{
  78. content: "";
  79. position:absolute;
  80. top: 0;
  81. border:0 solid $blue;
  82. border-width:20px 10px;
  83. width: 0;
  84. height: 0;
  85. }
  86. &:before{
  87. left:-20px;
  88. border-left-color:transparent;
  89. }
  90. &:after{
  91. left:100%;
  92. border-color:transparent;
  93. border-left-color:$blue;
  94. }
  95. &:hover{
  96. background-color: $green;
  97. &:before{
  98. border-color:$green;
  99. border-left-color:transparent;
  100. }
  101. &:after{
  102. border-left-color:$green;
  103. }
  104. }
  105. &:active{
  106. background-color: $green-darken;
  107. &:before{
  108. border-color:$green-darken;
  109. border-left-color:transparent;
  110. }
  111. &:after{
  112. border-left-color:$green-darken;
  113. }
  114. }
  115. }
  116. }
  117. }

第二种

查看样式