transform:rotate(45deg) 顺时针旋转45度

    1. <style>
    2. div{
    3. position: relative;
    4. width: 240px;
    5. height: 35px;
    6. border: 1px solid green;
    7. }
    8. div::after{
    9. content: "";
    10. position: absolute;
    11. top: 8px;
    12. right: 15px;
    13. width: 12px;
    14. height: 12px;
    15. border-right:1px solid green;
    16. border-bottom: 1px solid green;
    17. transform: rotate(45deg);
    18. transition: all 0.2s;
    19. }
    20. div:hover::after{
    21. transform: rotate(225deg);
    22. }
    23. </style>
    24. <body>
    25. <div></div>
    26. </body>

    image.pngimage.png