美文网首页
css仿聊天气泡样式

css仿聊天气泡样式

作者: 小小_chao | 来源:发表于2020-11-18 11:10 被阅读0次
css仿聊天气泡
/*原理:使用:after与:before伪类实现,侧边小冒尖可根据自己实际需求转换方向*/
/*示例:带边框的聊天气泡*/
.chatMsgModule{
    width:300px;
    height:60px;
    background:#cde5ff;
    margin-left:15px;
    border:1px solid #c2dfff;
}
.chatMsgModule:after{
    content:'';
    width:0;
    height:0;
    border-color:transparent #cde5ff transparent transparent;
    border-style:solid;
    border-width:6px;
    position:absolute;
    top:12px;
    right:100%;
    border-radius:3px;
}
.chatMsgModule:before{
    content:'';
    width:0;
    height:0;
    border-color:transparent #c2dfff transparent transparent;
    border-style:solid;
    border-width:7px;
    position:absolute;
    top:11px;
    right:100%;
    border-radius:3px;
}
带边框聊天气泡.png
/*示例:无边框的聊天气泡*/
.chatMsgModule{
    width: 120px;
    height: 80px;
    background: red;
    position: relative;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
}
.chatMsgModule:before {
    content: "";
    position: absolute;
    right: 100%;
    top: 26px;
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-right: 26px solid red;
    border-bottom: 13px solid transparent;
}

*推荐大家一个css绘制形状的网站:https://css-tricks.com/the-shapes-of-css/

注:该文主要针对聊天气泡的整理,有需要请自取哦~

相关文章

  • css仿聊天气泡样式

    css仿聊天气泡 *推荐大家一个css绘制形状的网站:https://css-tricks.com/the-sha...

  • JavaScript19

    1.仿微博发表评论 1)css样式 *{ margin:0; padding:0; } a{ text...

  • JS第二十天

    1.仿微博发表评论 1)css样式 {margin:0;padding:0;}a{text-decoration:...

  • css样式入门书目录

    css样式-字体属性 css样式-背景属性 css样式-边框属性 css样式-列表属性 css样式-定位属性 cs...

  • [jQuery]设置css样式

    获取css样式 设置单个css样式 设置多个css样式

  • js

    1.仿微博发表评论 1)css样式 2)div 3)script 把图片做成随机数

  • CSS基础(二)

    1 - CSS样式的引入 CSS样式的引入可以采用三种方式: 内联式css样式 嵌入式CSS样式 外部式CSS样式...

  • h5聊天室weChatRoom|仿微信群聊天室(多人聊天)

    html5+css3聊天室实战开发|h5仿微信聊天室界面|仿微信群聊/单聊 这个项目是利用h5开发的仿微信聊天室,...

  • 第十九天

    仿新浪微博发布评论 1)css样式 .main{width: 800px;margin:20px auto;}sp...

  • js day19

    1.仿微博发表评论 1)css样式 2)div 3)script 把图片做成随机数 2.仿新浪微博发布评论js代码...

网友评论

      本文标题:css仿聊天气泡样式

      本文链接:https://www.haomeiwen.com/subject/qpoqiktx.html