[html] Cut Corners using CSS

If you need a transparent cut out edge, you can use a rotated pseudo element as a background for the div and position it to cut out the desired corner:

Transprent cut out edge on a div

_x000D_
_x000D_
body {_x000D_
  background: url(http://i.imgur.com/k8BtMvj.jpg);_x000D_
  background-size: cover;_x000D_
}_x000D_
div {_x000D_
  position: relative;_x000D_
  width: 50%;_x000D_
  margin: 0 auto;_x000D_
  overflow: hidden;_x000D_
  padding: 20px;_x000D_
  text-align: center;_x000D_
}_x000D_
div:after {_x000D_
  content: '';_x000D_
  position: absolute;_x000D_
  width: 1100%; height: 1100%;_x000D_
  top: 20px; right: -500%;_x000D_
  background: rgba(255,255,255,.8);_x000D_
  transform-origin: 54% 0;_x000D_
  transform: rotate(45deg);_x000D_
  z-index: -1;_x000D_
}
_x000D_
<div>_x000D_
  ... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>_x000D_
</div>
_x000D_
_x000D_
_x000D_

Note that this solution uses transforms and you need to add the required vendor prefixes. For more info see canIuse.

To cut the bottom right edge, you can change the top, transform and transform-origin properties of the pseudo element to:

_x000D_
_x000D_
body {_x000D_
  background: url(http://i.imgur.com/k8BtMvj.jpg);_x000D_
  background-size: cover;_x000D_
}_x000D_
div {_x000D_
  position: relative;_x000D_
  width: 50%;_x000D_
  margin: 0 auto;_x000D_
  overflow: hidden;_x000D_
  padding: 20px;_x000D_
  text-align: center;_x000D_
}_x000D_
div:after {_x000D_
  content: '';_x000D_
  position: absolute;_x000D_
  width: 1100%; height: 1100%;_x000D_
  bottom: 20px; right: -500%;_x000D_
  background: rgba(255,255,255,.8);_x000D_
  transform-origin: 54% 100%;_x000D_
  transform: rotate(-45deg);_x000D_
  z-index: -1;_x000D_
}
_x000D_
<div>_x000D_
  ... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>... content ...<br/>_x000D_
</div>
_x000D_
_x000D_
_x000D_

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to css-shapes

How to create a inner border for a box in html? CSS Circle with border How to Make A Chevron Arrow Using CSS? How to make a div with a circular shape? How to make rectangular image appear circular with CSS Half circle with CSS (border, outline only) How to draw a checkmark / tick using CSS? how to draw a rectangle in HTML or CSS? CSS3 Transform Skew One Side Center Triangle at Bottom of Div