带箭头的div

如果箭头不需要边框效果,一个元素搞定了

<s></s>

<i></i>

:before 或者 :after (content:"  ")  

都可以完成

 

如果需要边框效果,一般都是由两个元素,设置不同的颜色和显示位置,从而有了边框的效果

如:before和after一起使用

**  定义before-after选择器  **/
.before-after-common {
  bottom: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  z-index:1;
}
div.mini-table{
  background-color:#ebf5fd;
  /*overflow:hidden; 可以避免外边距合并但影响箭头显示*/
  position:relative;
  padding:0.5px 0px; /** avoid 外边距合并 **/
  &:before{
    .before-after-common;
    right: 22%;
    border-bottom-color: #ddd;
    border-width: 8px;
    
  }
  &:after{
    .before-after-common;
    right: 265;
    border-bottom-color: #ebf5fd;
    border-width: 7px; 
  }
}

上面为less代码。

--------------------------------------------------------------------

<s>

  <i></i>

</s> 

这样也是可以实现的。

               

posted on 2015-10-22 17:29 Rhett_Web 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/rhett-web/p/4901707.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值