Skip to main content
added 555 characters in body
Source Link
isherwood
  • 61.4k
  • 16
  • 122
  • 173

You could use linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

See it on CodePen

.parent-div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.child-div {
  height: 100px;
  width: 100px;
  background: black;
  background: linear-gradient(135deg, transparent 10px, black 0);
  opacity: .6;
}
<div class="parent-div">
  <div class="child-div"></div>
</div>

Further reading:

You could use linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

See it on CodePen

Further reading:

You could use linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.child-div {
  height: 100px;
  width: 100px;
  background: black;
  background: linear-gradient(135deg, transparent 10px, black 0);
  opacity: .6;
}
<div class="parent-div">
  <div class="child-div"></div>
</div>

Further reading:

Add CodePen example, format links
Source Link
Nathan Arthur
  • 9.3k
  • 7
  • 65
  • 83

You could use a linear-gradientlinear-gradient. Let's say the parent divdiv had a background image, and you needed a divdiv to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

http://css-tricks.com/css3-gradients/See it on CodePen

http://lea.verou.me/2011/03/beveled-corners-negative-border-radius-with-css3-gradients/ Further reading:

You could use a linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

http://css-tricks.com/css3-gradients/

http://lea.verou.me/2011/03/beveled-corners-negative-border-radius-with-css3-gradients/

You could use linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

See it on CodePen

Further reading:

Source Link
Nate
  • 1.4k
  • 1
  • 13
  • 23

You could use a linear-gradient. Let's say the parent div had a background image, and you needed a div to sit on top of that with a gray background and a dog-eared left corner. You could do something like this:

.parent-div { background: url('/image.jpg'); }
.child-div { 
   background: #333;
   background: linear-gradient(135deg, transparent 30px, #333 0);
}

http://css-tricks.com/css3-gradients/

http://lea.verou.me/2011/03/beveled-corners-negative-border-radius-with-css3-gradients/