CSS3執行個體代碼:相容多瀏覽器的麵包屑

來源:互聯網
上載者:User

文章簡介:相容多瀏覽器的麵包屑.

麵包屑是Web中常見的一個元件,早前在《CSS3製作Breadcrumbs》和案例《css3麵包屑設計》使用CSS3製作了各式各樣的麵包屑效果,今天使用上原始的CSS配合一定的標籤製作了一款相容多瀏覽器的麵包屑案例,感興趣的可以看看:

HTML

<ul class="clearfix">
  <li>麵包屑一<em></em><i></i></li>
  <li class="current">麵包屑二<em></em><i></i></li>
  <li>麵包屑二<em></em><i></i></li>
</ul>
CSS

.demo{
  width:600px;
  margin:100px auto;
  background:#f0f0f0;
  height:32px;
  overflow:hidden;
  line-height:32px;
  position:relative;
}
.demo li{
  float:left;
  width:200px;
  text-align:center;
  position:relative;
  z-index:2;
  font-weight:bold;
  font-size:14px;
}
.demo li em{
  position:absolute;
  right:-24px;
  top:-8px;
  width:0;
  height:0;
  line-height:0;
  border-width:24px 0 24px 24px;
  border-color:transparent  transparent transparent #fff;
  border-style:dashed dashed dashed solid;
}
.demo li i{
  position:absolute;
  right:-16px;
  top:0;
  width:0;
  height:0;
  line-height:0;
  border-width:16px 0 16px 16px;
  border-color:transparent  transparent transparent #f0f0f0;
  border-style:dashed dashed dashed solid;
}
.demo li.current{
  background:#f60;
  color:#fff;
  z-index:1;
}
.demo li.current i{
  border-color:transparent  transparent transparent #f60;
}



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.