[css] How to draw a non-90-degree oblique line in pure css

The original po guide:  https://www.jianshu.com/p/e31fe2578352

              width: 74px;   /* 调整角度 */
              height: 104px; /* 调整角度 */
              background: linear-gradient(
                      to top right,  /* 直线走向 */
                      rgba(0,0,0,0) 0%,
                      rgba(0,0,0,0) calc(50% - 1.5px),
                      #FFF072 50%,  /* 走向左上 => 右下  修改直线颜色 */  
                      rgba(0,0,0,0) calc(50% + 1.5px),
                      rgba(0,0,0,0) 100%
              ),linear-gradient(
                      to bottom right,
                      rgba(0,0,0,0) 0%,
                      rgba(0,0,0,0) calc(50% - 1.5px),
                      rgba(0,0,0,0) 50%,  /* 走向左下 => 右上  修改直线颜色 */
                      rgba(0,0,0,0) calc(50% + 1.5px),
                      rgba(0,0,0,0) 100%
              );

 

Guess you like

Origin blog.csdn.net/Weiqian_/article/details/126887478