How would one create a triangle container for an image (x-browser)

前端 未结 2 412
无人共我
无人共我 2021-01-18 06:48

How would I create a DIV containing an IMG where the DIV cuts the image into a triangle, thereby displaying only part of the image though a triangle.

so..



        
2条回答
  •  -上瘾入骨i
    2021-01-18 07:44

    Depending on what you want the outcome to be, as far as i'm aware you cant make a triangle DIV without Transform:; However one solution would be having a div positioned inside the div in question with a PNG cutting of half the image showing only the transparent part through. Not sure if this is a viable option for you though.

提交回复
热议问题