1. 程式人生 > >帶三角形的邊框

帶三角形的邊框

-h abs color tran pla xhtml bottom tle bsp

大家可直接復制粘貼,利用css3的一些新屬性,即可實現氣泡的對話框

<!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>
<title></title>
<style type="text/css">
.tag
{
width: 300px;
height: 100px;
border: 5px solid #09F;
position: relative;
}
.tag em
{
display: block;
border-width: 20px;
position: absolute;
bottom: -40px;
left: 100px;
border-style: solid dashed dashed;
border-color: #09F transparent transparent;
font-size: 0;
line-height: 0;
}
.tag span
{
display: block;
border-width: 20px;
position: absolute;
bottom: -33px;
left: 100px;
border-style: solid dashed dashed;
border-color: #FFF transparent transparent;
font-size: 0;
line-height: 0;
}
</style>
</head>
<body>
<div class="tag">
<em></em>CSS氣泡框實現
</div>
<div class="tag" style="margin-top: 100px">
<em></em><span></span>CSS氣泡框實現
</div>
</body>
</html>

帶三角形的邊框