阅读:5731回复:0
用border写三角形<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <style> body{margin:0 auto;text-align:center} .suqare{ margin:2em auto; width:5em; height:2.5em; background-color:#71BF15; position:relative} .sanjiao{ border: 2em solid transparent; border-bottom-color:#71BF15; position:absolute;top:2em; left:50%; margin-left:-2em} </style> </head> <body> <div class="suqare"> <span class="sanjiao"></span> </div> </body> </html> .sanjiao{ border: 2em solid transparent; border-bottom-color:#71BF15; position:absolute;top:2em; left:50%; margin-left:-2em} |
|