首页 技术 正文
技术 2022年11月8日
0 收藏 919 点赞 1,967 浏览 1521 个字

小颖昨天分享了一篇参考bootstrap中的popover.js的css画消息弹框今天给大家再分享一篇使用:before和:after伪元素画消息弹框的CSS。

画出来是介个酱紫的:

利用CSS中的:after、: before制作的边三角提示框

有没有觉得画的萌萌哒,嘻嘻利用CSS中的:after、: before制作的边三角提示框

不贫了,我们一起看代码吧!啦啦啦啦啦啦啦

<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title></title>
<style media="screen">
.arrow_box {
position: relative;
border: 1px solid #c2e1f5;
padding: 10px;
width: 200px;
height: 100px;
border-radius: 6px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
margin: 50px;
float: left;
} .arrow_box:before,
.arrow_box:after {
position: absolute;
display: block;
width: 0;
height: 0;
border: solid transparent;
pointer-events: none;
content: "";
border-color: rgba(136, 183, 213, 0);
} .arrow_box.down:before {
border-bottom-color: #c2e1f5;
border-width: 12px;
left: 49%;
margin-left: -10px;
bottom: 100%;
} .arrow_box.down:after {
border-bottom-color: #fff;
border-width: 10px;
left: 50%;
margin-left: -10px;
bottom: 100%;
} .arrow_box.up:before {
border-top-color: #c2e1f5;
border-width: 12px;
left: 49%;
margin-left: -10px;
top: 100%;
} .arrow_box.up:after {
border-top-color: #fff;
border-width: 10px;
left: 50%;
margin-left: -10px;
top: 100%;
} .arrow_box.left:before {
border-left-color: #c2e1f5;
border-width: 13px;
top: 38%;
left: 100%;
} .arrow_box.left:after {
border-left-color: #fff;
border-width: 10px;
top: 41%;
left: 100%;
} .arrow_box.right:before {
border-right-color: #c2e1f5;
border-width: 13px;
top: 38%;
right: 100%;
} .arrow_box.right:after {
border-right-color: #fff;
border-width: 10px;
top: 41%;
right: 100%;
}
</style>
</head><body>
<div class="popovers-body">
<div class="arrow_box down"></div>
<div class="arrow_box up"></div>
<div class="arrow_box left"></div>
<div class="arrow_box right"></div>
</div>
</body></html>

参考网站:css after before制作的边三角提示框

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,087
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,562
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,412
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,185
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,821
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,905