css3 2种画图标识效果

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		
		<style>
			/* 标识 1 */
			.tips-block-group {
				position: relative;
				margin: 20px;
				border: 1px solid #eee;
			}
			.tips-block {
				position: relative;
				left: -6px;
				top: 6px;
				width: 60px;
				height: 30px;
				line-height: 30px;
				font-size: 14px;
				background: #00AAFF;
				color: #fff;
				text-align: center;
				z-index: 2;
			}
			.tips-block::before {
				content: "";
				position: absolute;
				left: 0;
				top: 100%;
				z-index: -1;
				border-left: 3px solid transparent;
				border-bottom: 3px solid transparent;
			}
			.tips-block::before {
				border-right: 3px solid #0089c9;
				border-top: 3px solid #0089c9;
			}
			.tips-block-group p {
				margin-left: 30px;
			}
		</style>
	</head>
	<body>
		<div class="tips-block-group">
			<div class="tips-block">
				标识 1
			</div>
			<p>这是一个页面内容</p>
		</div>

	</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		
		<style>
			/* 标识 2 */
			.tips-group {
				position: relative;
				margin: 20px;
				display: flex;
				flex: 1 1 auto;
				z-index: 2;
				border: 1px solid #eee;
			}
			.tips {
				position: absolute;
				width: 60px;
				height: 60px;
				text-align: center;
				left: -5px;
				top: -5px;
				overflow: hidden;
			}
			.tips span {
				position: absolute;
				display: block;
				transform: rotate(-45deg);
				background-color: #00AAFF;
				width: 70px;
				top: 8px;
				left: -20px;
				font-size: 12px;
				color: #fff;
				padding: 2px 0;
				z-index: 1;
			}
			.tips span::before {
				content: "";
				position: absolute;
				left: 4px;
				top: 100%;
				z-index: -1;
				border-right: 3px solid transparent;
				border-bottom: 3px solid transparent;
			}
			.tips1 span::before {
				border-left: 3px solid #0089c9;
				border-top: 3px solid #0089c9;
			}
			
			.tips span::after {
				content: "";
				position: absolute;
				right: 0;
				top: 100%;
				z-index: -1;
				border-left: 3px solid transparent;
				border-bottom: 3px solid transparent;
			}
			.tips1 span::after {
				border-right: 3px solid #0089c9;
				border-top: 3px solid #0089c9;
			}
			
			.tips-group p {
				margin-left: 30px;
			}
			
		</style>
	</head>
	<body>
		<div class="tips-group">
			<div class="tips tips1">
				<span>提示 2</span>
			</div>
			<p>这是一个页面内容</p>
		</div>
		
	</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值