带三角缺口的边框

王朝学院·作者佚名  2016-05-24
窄屏简体版  字體: 小  |  中  |  大  |  超大  

带三角缺口的边框以前看漫画的时候如果有对话内容,一般会有一个边框,然后带着一个三角从说话人的身上引出。类似下图这样:

应该有很多方法来实现,这里提供的办法就是创造一个边框,然后用两个三角覆盖。效果如下:

为了方便理解,我给body加了个黑色背景,是这样:

代码如下:

<!doctype html><html><head><meta charset="UTF-8"><title>带三角缺口的边框</title><style>.out { display:block; width:0; height:0; border-left:6px dashed transparent; border-right:6px dashed transparent; border-top:0; border-bottom:7px solid #ccc; position:relative; top:-7px; left:50%;}.inner { position:absolute; border-left:6px dashed transparent; border-right:6px dashed transparent; border-top:0; border-bottom:7px solid #fff; left:-6px; top:2px;}div { position:relative; margin:0 auto; width:80px; height:100px; border:1px solid #ccc; border-radius:5px;} </style></head><body><div><span class="out"> <span class="inner"></span></span></div></body></html>

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航