鍍金池/ 問答/HTML/ css 樣式設(shè)計

css 樣式設(shè)計

這個當(dāng)點擊的時候怎么設(shè)計這個箭頭樣式。

回答
編輯回答
離魂曲

在這個DIV里用偽元素的border畫三角形然后定位就行。
演示demo

2018年8月9日 16:35
編輯回答
不將就

矩形+三角形 三角形用border做

2017年9月15日 12:07
編輯回答
浪婳
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .item {
      background-color: deepskyblue;
      margin-bottom: 8px;
      width:160px;
      position: relative;
      height:40px;
      line-height: 40px;
    }
    .item::after {
      content: '';
      position: absolute;
      left:100%;
      width: 0;
      height: 0;
      border-top: 20px solid transparent;
      border-bottom: 20px solid transparent;
      border-left: 20px solid deepskyblue;
    }
  </style>
</head>
<body>
<ul style="list-style: none;">
  <li class="item">2+2雙學(xué)士本科項目</li>
  <li class="item">1+1雙學(xué)士學(xué)位</li>
</ul>
</body>
</html>
2018年1月18日 08:24