快捷导航

:after,:before的绝对定位问题

Document    .reply {    position: relative;    width: 200px;    height: 80px;    border: 1px solid rgba(243, 237, 127, 0.68);    border-radius: 5px;    background-color: rgba(243, 237, 127, 0.35);  }   .reply:after {    content: '';    width: 0px;    height: 0px;    border-color: transparent transparent rgba(243, 237, 127, 0.35) transparent;    border-style: solid;    border-width: 6px;    position: absolute;    top: -11px;    border-radius: 3px;    left: 18px;    right: auto;  }   .reply:before {    content: '';    width: 0px;    height: 0px;    border-color: transparent transparent rgba(243, 237, 127, 0.68) transparent;    border-style: solid;    border-width: 7px;    position: absolute;    top: -14px;    border-radius: 3px;    left: 17px;    right: auto;  }   
实现简单的聊天气泡(如下图),我的问题是两个伪类中top和left的值应该如何设置呢?

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

你的效果不是正常的嘛,有什么问题?
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP