css样式实现平行四边形
强大的css样式实现平行四边形:
啥也不说了,直接上代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style type="text/css"> .parallelogram { width: 60px; height: 35px; transform:skewX(-30deg); text-align: center; line-height: 35px; background-color: rgb(43, 45, 126); margin: 50px ; color: aliceblue; } .parallelogram>p{ transform: skewX(30deg); } </style> </head> <body> <div class="box"> <div class="parallelogram"> <p>资讯</p> </div> </div> </body> </html>