Diamond menu items using CSS and SVG

后端 未结 4 1645
無奈伤痛
無奈伤痛 2021-02-09 13:37

I want to code the below design in HTML&CSS

\"enter

What I made so far is:

4条回答
  •  伪装坚强ぢ
    2021-02-09 13:54

    Did you try css rotate to restrict the rectangle. You could use SVG anyway as the background now.

    .m-item {
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    border: 2px solid #000;
    background-color: black;
    padding: 50px;
    position: absolute;
    transform: rotate(45deg) translate(25px);
    }
    .m-item span {
    position: absolute;
    transform: rotate(-45deg) translate(0, -14px);
    }
    .m-item:hover {
    background-color: #AA5;
    }
    m1

提交回复
热议问题