Home > OS >  How to create two columns and one of them shaped?
How to create two columns and one of them shaped?

Time:03-04

I need to create two columns. Variable-length text on the left and an image on the right.

Example

I tried clip-path but no luck.

Thank you jval

CodePudding user response:

clip-path can do it. Here is an overview:

.box {
  display: grid;
  grid-auto-flow: column;
  height: 300px;
}

.box div:first-child {
  background: blue;
  clip-path: polygon(0 50px, 100% 0, 100% 100%, 0 calc(100%   50px)); 
  box-shadow:0 0 0 50px blue;
}

.box div:last-child {
  background: red;
}
<div >
  <div></div>
  <div></div>
</div>

  •  Tags:  
  • css
  • Related