网站中有一些常见的图形用css就可以实现出来,本人就此总结了几种常用的css图形画法,引用链接http://www.cnblogs.com/lovemomo/p/4878293.html
.circle{ margin-top:50px; width: 100px; height: 100px; background:red; -moz-border-radius:50px; -webkit-border-radius:50px; border-radius: 50px; }
.moon{ width: 80px; height: 80px; border-radius: 50%; box-shadow: 15px 15px 0 0 red; }
.triangle-up { width: 0; height: 0; border-left:50px solid transparent; border-right: 50px solid transparent; border-bottom: 50px solid #ccc; }
下三角同理
.triangle-left { width: 0; height: 0; border-top:50px solid transparent; border-right: 50px solid #ccc; border-bottom: 50px solid transparent; }
右三角同理
.triangle-topleft { width: 0; height: 0; border-top: 50px solid #ccc; border-right:50px solid transparent; }
.triangle-bottomleft { width: 0; height: 0; border-bottom: 50px solid #ccc; border-left:50px solid transparent; }
#demo{ width: 100px; height: 100px; background-color: #333; position: relative; }#demo:after{ border:solid transparent; border-left-color:#333; border-width:10px; width:0; content:" "; position:absolute; left:100%; top:10%; }
#demo{ width: 100px; height: 100px; background-color:#fff; position:relative; border: 2px solid #000; /*整体颜色边框是黑色*/}/*小三角*/#demo:after{ border:solid transparent; border-left-color:#fff; border-width:10px; content:" "; position:absolute; left:100%; top:20px; /*20px*/}/*大三角*/#demo:before{ border:solid transparent; border-left-color:#000; border-width:12px; /*10px+2px*/ content:" "; position:absolute; left:100%; top:18px; /*20px-2px*/}
css之创建常用图形