CSS技巧之向下箭头

思路:
使用◇符号(可在输入法的软键盘找到该符号),使用定位选择位置,并隐藏溢出的上半部分
细点:
1.使用i标签的楷体属性把◇变大
2.给i只有◇符号一半的高度,并隐藏溢出,正常显示一个向上箭头
3.对s使用绝对定位,使用top属性并为负值使i容器显示向下箭头

<!DOCTYPE>
<html>
<head>
  <meta charset="utf-8">
  <title>向下箭头</title>
  <style type="text/css">
    i{
      font-style: normal;/* 使其字体正常 */
    }
    s{
      text-decoration: none;/*使删除线消失*/
    }
    .content{
      width:300px;
      height: 300px;
      margin: 50px auto 0;/*左右居中,top值50px*/
      border:1px solid #ccc;
    }
    .set{
      width:100px;
      margin: 20px auto;/*左右居中,上下20px*/
      position: relative;
    }
    .set i{
      font-size: 15px;/*字号*/
      line-height: 15px;/*行高*/
      font-family: '楷体';/*字体*/
      /* font: 15px/15px '楷体'; 上述总写*/
      padding: 0 10px;
      position: absolute;/*绝对定位*/
      top: 7px;
      right: 5px;
      width: 15px;
      height: 7px;
      overflow: hidden;/*隐藏溢出*/
    }
    .set s{
      position: absolute;
      top:-7px;
    }
  </style>
</head>
<body>
  <div class="content">
    <div class="set">
      更多设置
      <i><s>◇</s></i>
    </div>
  </div>
</body>
</html>

 

posted @ 2018-05-16 22:20  枫雨血痕  阅读(1325)  评论(0编辑  收藏  举报