arrow css

本文介绍了一种使用HTML和CSS进行网页元素定位的方法,通过不同层级及样式的组合实现特定效果。利用绝对定位、边框及背景等属性,可以创建三角形装饰和其他自定义样式。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
.tri {
position: absolute;
left: -21px;
top: 40px;
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border: 12px solid #e5e5e5;
border-color: transparent #e5e5e5 transparent transparent;
border-style: dashed solid dashed dashed;
display: block;
}
 
.show {
display: block;
left: 230px;
top: 0;
width: 224px;
line-height: 20px;
font-size: 12px;
background: #fff;
border: 3px solid #ededed;
padding: 5px 0;
overflow: hidden;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.trii {
position: absolute;
left: -2px;
top: -7px;
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border: 7px solid #fff;
border-color: transparent #fff transparent transparent;
border-style: dashed solid dashed dashed;
 
.showid{position:absolute;top:-21px;left:40px;height:0;line-height:0;
    font-size:0;border:12px solid #ededed;border-color:transparent transparent #ededed transparent;border-style:dashed dashed solid dashed;
 }
 .showname{position:absolute;top:-1px;left:-8px;border:8px solid #fff;border-color:transparent transparent #fff transparent;border-style:dashed dashed solid dashed;height:0;line-height:0;font-size:0;}
.topshow{
   border:4px solid #ededed;padding:6px;height:100px;width:100px;margin:auto; word-break:break-all; word-wrap:break-word;
}
</style>
</head>
 
<body>
<div style="position:relative;margin:100px 200px 50px">
 <div class="tri" ><div class="trii"></div></div>
 <div class="show" style="height:100px"></div>
</div> 
 
 
<div style="position:relative;width:100px;height:100px;">
 <div class="showid"><div class="showname"></div></div>
 <div class="topshow">11111333333333</div>
</div>
</body>
</html>

转载于:https://www.cnblogs.com/sunrise/p/3490848.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值