There are several ways to achieve this (including JS and SVG solutions). However I think the easiest solution using pure CSS is using some pseudo-elements (to render the jagged edges) in combination with linear-gradient
and multi-backgrounds feature. Here is the demo code:
div {
width:200px;
height:250px;
background:white;
position:relative;
margin-top:25px;
}
div:before, div:after {
content:'';
width:100%;
height:5px;
position:absolute;
bottom:100%;
left:0;
background-image: linear-gradient(135deg, transparent 66%, white 67%),
linear-gradient(45deg, white 33%, gray 34%, transparent 44%);
background-position: -5px 0;
background-size: 10px 100%;
background-repeat:repeat-x;
}
div:after {
top:100%;
bottom:auto;
background-image: linear-gradient(135deg, white 33%, gray 34%, transparent 44%),
linear-gradient(45deg, transparent 66%, white 67%);
}
body {
background:url(http://placekitten.com/800/600);
}