最终效果如图:

 

demo

概念1:边框的设置

 

.arrow {
  width: 0; height: 0;

  border: 100px solid;
  border-color: red green blue yellow;
}

border-all

 

 

概念1:边框的设置->变三角   

 

 

.arrow {
  width: 0; height: 0;

  border: 100px solid;
  border-bottom-color: blue;
}
如果要向下的尖头,改成 border-top-color:blue; 其他依次论推.
 

 

 

源代码: 

<!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>Untitled Document</title>
<style type="text/css">
/*
   Speech Bubbles
   Usage: Apply a class of .speech-bubble and .speech-bubble-DIRECTION
   <div class="speech-bubble speech-bubble-top">Hi there</div>
*/
 body{margin-left:50px;}
.speech-bubble {
  position: relative;
  background-color: #292929;
 
  width: 200px;
  height: 150px;
  line-height: 150px; /* vertically center */
 
  color: white;
  text-align: center;
  border-radius: 10px;
 
  font-family: sans-serif;
}
 
.speech-bubble:after {
  content: '';
  position: absolute;
 
  width: 0;
  height: 0;
 
  border: 15px solid;
}
 
/* Position the Arrow */
 
.speech-bubble-top:after {
  border-bottom-color: #292929;
 
  left: 50%;
  bottom: 100%;
  margin-left: -15px;
}
.speech-bubble-right:after {
  border-left-color: #292929;
 
  left: 100%;
  top: 50%;
  margin-top: -15px;
}
 
.speech-bubble-bottom:after {
  border-top-color: #292929;
 
  top: 100%;
  left: 50%;
  margin-left: -15px;
}
 
.speech-bubble-left:after {
  border-right-color: #292929;
 
  top: 50%;
  right: 100%;
  margin-top: -15px;
}
 
</style>
</head>
 
<body>
 
<div class="speech-bubble speech-bubble-top">
    <p>Text goes here.</p>
</div>
 
<div class="speech-bubble speech-bubble-right">
    <p>Text goes here.</p>
</div>
 
<div class="speech-bubble speech-bubble-bottom">
    <p>Text goes here.</p>
</div>
 
<div class="speech-bubble speech-bubble-left">
    <p>Text goes here.</p>
</div>
 
</body>
</html>
 IE对after、before是不支持的,请在firefox、opera、chrome下试调!