帶箭頭矩形指示框、氣泡框

html代碼:html

<div class="tag">
  <em></em>
  <span class="white-triangle"></span>
  <p>
    <span>!</span>
    投放時間與排期不符!
  </p>
</div>less

 

less代碼:spa

/********帶箭頭矩形框*******/htm

.common-style(@left:20px, @top:-20px, @border-width:10px, @border-color:#ddd) {
  width: 0;
  height: 0;
  line-height: 0; /***爲解決ie6兼容性問題*/
  font-size: 0; /***爲解決ie6兼容性問題*/
  border-style: dashed dashed solid; /***爲解決ie6兼容性問題*/
  border-color: transparent transparent @border-color;
  border-width: @border-width;
  position: absolute;
  left: @left;
  top: @top;
}blog

.tag {
  border: 1px solid #ddd;
  padding: 20px 15px;
  background-color: #fff;
  font-size: 14px;
  color: #666;
  position: relative;
  em {
    .common-style;
  }
  .white-triangle {
    .common-style(22px, -16px, 8px, #fff);
  }
  p {
    span {
      width: 18px;
      height: 18px;
      border-radius: 18px;
      text-align: center;
      line-height: 18px;
      background-color: #ff9595;
      display: inline-block;
      color: #fff;
      margin-right: 5px;
    }
  }
}
it

 

效果圖:io

相關文章
相關標籤/搜索