Creating a diagonal line/section/border with CSS

前端 未结 6 1783
离开以前
离开以前 2020-12-07 23:34

I am trying to create a diagonal line on a webpage, to act as a section/section break. This is essentially a split colour section. I cant use an image as if the page gets en

6条回答
  •  太阳男子
    2020-12-08 00:09

    Use a linear gradient

    div {
      height: 90px;
      background-image: linear-gradient(to bottom right, yellow, yellow 50%, black 50%, black);
    }

提交回复
热议问题