// The only colors used. $grey: #CCC; $black: #000; $white: #FFF; $base: 10px; .container { width: 100%; position: absolute; top: 0; bottom: 0; display: -webkit-flex; display: flex; align-items: center; justify-content: center; } .mask { width: 50*$base; height: 50*$base; position: relative; overflow: hidden; } .content { width: 50*sqrt(2)*$base; height: 50*sqrt(2)*$base; transform: rotate(45deg); position: absolute; top: -100px; left: -100px; } .bar { width: 100%; height: $base; margin-top: 5*$base; background: $black; position: relative; } .barb { height: 4*$base; width: $base; background: $black; float: left; margin: 1*$base; margin-top: -1.5*$base; } .positive { transform: skewX(45deg); } .negative { transform: skewX(-45deg); } .content:hover { .barb { display: none; } } @import url(http://fonts.lug.ustc.edu.cn/css?family=Open+Sans); .caption { background: $white; color: $black; position: absolute; top: 0px; left: 0px; z-index: 100; font-size: 2em; text-align: center; width: 100%; font-family: Open Sans, sans-serif; }