search

Home  >  Q&A  >  body text

javascript - css 三角形缺口,

如图:

这个三角形缺口是透明的,请问咋个实现

大家请注意问题的关键,三角形能看见后面的背景

伊谢尔伦伊谢尔伦2767 days ago634

reply all(7)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:19:27

    What I did before was to add a row of small p's with a height of a few px on the navigation bar, all with a white background
    The selected background is a transparent "white background with gap" image

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:19:27

    p {
        width: 0;
        height: 0;
        border: 10px solid #fff;
        border-top-color: transparent;
    }

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:19:27

    It is probably impossible to make a transparent triangle.

    But you can make two white trapezoids and leave the triangle in the middle.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:19:27

    Use border to modify the triangle. If you want to make it transparent, use rgba

    p{

    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: rgba(0,0,0,0.4)

    }

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 15:19:27

    Send out the page address and you will know after some research

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:19:27

    I agree with Xiao U-chan, I only think of this solution:

    ————————————Gorgeous dividing line————————————————
    The effect created by rotate:

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 15:19:27

    p::before {
        content: "";
        display: block;
        position: absolute;
        bottom: 0;
        left: -10px;
        width: 20px; /*自己调*/
        border: 10px solid transparent;
        border-bottom-color: white;
    }
    
    p::after {
        content: "";
        display: block;
        position: absolute;
        bottom: 0;
        right: -10px;
        width: 88px; /*自己调*/
        border: 10px solid transparent;
        border-bottom-color: white;
    }

    reply
    0
  • Cancelreply