1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
| <style type="text/css"> * { margin:0; padding:0; } .outBox { width:200px; height:1000px; margin:0 auto; } .fourSide { width:50px; height:50px; border-top:50px solid #f00; border-bottom:50px solid rgb(0, 255, 149); border-left:50px solid rgb(138, 115, 223); border-right:50px solid rgb(235, 104, 235); background-color:yellowgreen; } .limited { width:0px; height:0px; border-top:50px solid #f00; border-bottom:50px solid rgb(0, 255, 149); border-left:50px solid rgb(138, 115, 223); border-right:50px solid rgb(235, 104, 235); background-color:yellowgreen; } .Triangle { width:0px; height:0px; border-top:0px solid #f00; border-bottom:50px solid rgb(0, 255, 149); border-left:50px solid transparent ; border-right:50px solid transparent ; } .Triangle-left { width:0px; height:0px; border-top:50px solid transparent; border-bottom:50px solid transparent; border-left:50px solid rgb(138, 115, 223) ; border-right:0px solid rgb(235, 104, 235) ; } .half { width:0px; height:0px; border-bottom:50px solid rgb(0, 255, 149); border-left:50px solid rgb(138, 115, 223); } .Rectangular { width:0px; height:0px; border-bottom:transparent 50px solid; border-left:50px solid rgb(138, 115, 223); } .talkBox { position:relative; width:400px; height:50px; line-height:50px; background-color:thistle; text-align:center; } .talkBox:before { position:absolute; left:40px; bottom:-30px; content:""; display:block; width:0px; height:0px; border-left:30px solid thistle; border-bottom:transparent 30px solid; } </style> </head> <body> <div class="outBox"> <div> <div class="fourSide"> </div> <p>直观地理解边框</p> </div> <div> <div class="limited"> </div> <p>边框的极限形式</p> </div> <div> <div class="Triangle"> </div> <p>三角形下</p> </div> <div> <div class="Triangle-left"> </div> <p>三角形左</p> </div> <div> <div class="half"> </div> <p>2个等腰直角三角形:即是通过只设置相邻2边边距(剩下的2边不设置边距也就是说边距为0),使整个外框X/Y 方向长度均折半,正好切出2个等腰直角三角形,并且自身边距保持不变</p> </div> <div> <div class="Rectangular"> </div> <p>在2个等腰直角三角形的基础之上,设置其中一边透明,即会得到1个等腰直角三角形</p> </div> <div class="talkBox"> <p>这仅仅是一个开始!需要主动探索不一样的感觉。</p> </div> <div> </body>
|