DIV+CSS pseudo-element implements header slash

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
        #star-six {
            width: 100px;
            height: 100px;
            border: 1px solid black;
            position: relative;
        }


            #star-six::before {
                position: absolute;
                top: 0;
                right: 0;
                left: 0;
                bottom: 0;
                border-bottom:100px solid #000;
                border-left: 99px solid transparent;
                content: "";
            }


            #star-six::after {
                position: absolute;
                left: 1px;
                right: 0;
                top: 1px;
                bottom: 0;
                border-bottom: 99px solid #fff;
                border-left: 98px solid transparent;
                content: "";
            }
    </style>
</head>
<body>
    <div id="star-six"></div>
</body>
</html>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326110731&siteId=291194637