纯DIV+CSS倾斜导航条,有图有真相

  • <!doctype HTML>
  • <html>
  • <head>
  • <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  • <title>纯CSS倾斜导航</title>
  • <style type="text/css">
  • body{background-color:#ccc;font-size:12px;}
  • .nav{float:left;margin-left:2px;height:0;line-height:0;border:0;border-left:25px solid transparent;border-bottom:25px solid #f50;}
  • .nav .link{float:left;margin-right:-25px;height:0;line-height:0;border:0;border-right:25px solid transparent;border-top:25px solid #f50;color:#000;text-decoration:none;}
  • .nav .link:hover{color:#09c;}
  • .nav .link span{display:block;margin-top:-25px;padding:0 10px;height:25px;line-height:25px;text-align:center;cursor:pointer;}
  • `
  • .nav{_border-left:25px solid dashed;}
  • .nav .link{_margin-bottom:-25px;_position:relative;_z-index:1;_border-right:25px solid dashed;}
  • .nav .link span{_float:left;_position:relative;_z-index:2;}
  • </style>
  • </head>
  • <body>
  • <div class="nav">
  • <a href="#" target="_blank" class="link">
  • <span>首页</span>
  • </a>
  • </div>
  • <div class="nav">
  • <a href="#" target="_blank" class="link">
  • <span>产品列表</span>
  • </a>
  • </div>
  • <div class="nav">
  • <a href="#" target="_blank" class="link">
  • <span>下载与支持</span>
  • </a>
  • </div>
  • <div class="nav">
  • <a href="#" target="_blank" class="link">
  • <span>好像还能自适应宽度,要多长可以有多长</span>
  • </a>
  • </div>
  • </body>
  • </html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值