开发者社区 问答 正文

麻烦的问题

screenshot
如上图
末尾的span和s哪去呢

展开
收起
杨冬芳 2016-06-02 08:53:53 1678 分享 版权
1 条回答
写回答
取消 提交回答
  • IT从业

    一种方案,不过这样最好只限制显示一行:

    <a href="#" class="item">
      <s class="play_icon cuicons"></s>
      <em>如何使用更换档位</em>
      <span class="item-tail">
        <span class="recent_study"></span>
        <s class="right_icon cuicons"></s>
      </span>
    </a>
    .item{
       position:relative;
       padding-right:300px;
       height:24px;
       line-height:24px;
       overflow:hidden;
       text-overflow:ellipsis; /* 可选 */
    }
    .item-tail{
       position:absolute;
       top:0;
       right:0;
       width:300px;
       height:24px;
       overflow:hidden;
    }
    /*...*/
    2019-07-17 19:23:53
    赞同 展开评论
问答地址: