Div with slanted div overylay?

Hi there,

Ia m trying to create the following effect with a background image, text and slanted overlay, however I am struggling to do this.

This is what I am trying to create:
image

This is a fiddle I have.

I am trying to set the #ececec background to transparent so I can place it on top of an image to have an overlay effect on an image, but not sure how to do this.

Can anyone help me with this? If I set the border-right: 100px solid #ececec; to transparent, it takes the blue colour.

Some of your CSS is off. I don’t know if these will resolve the problem, but they should be fixed:

.slanted:after,
.slanted:before {
: should be :: (single colon should be double colons)
.slanted::after,
.slanted::before {

.slanted-right.slant-to-right:after
: should be :: (single colon should be double colons)
.slanted-right.slant-to-right::after

I would use clip-path as its more controllable.

Here’s a bare bones example.

1 Like

Awesome, many thanks :slight_smile: I will have a play

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.