Как с помощью стилей добиться треугольных скосов в блоках?

by Denis Tverdokhlebov

HTML

<span class="item has_right_arr debug">Hello world! Debug</span>
<br/>
<span class="item has_right_skew debug">Hello everyone! Debug</span>
<br />
<span class="item has_right_arr">Hello world!</span>
<br/>
<span class="item has_right_skew">Hello everyone!</span>
<br />
<span class="item has_right_arr debug">Big big<br/>Big! Debug</span>
<br/>
<span class="item has_right_skew debug">Big big<br/>Big everyone! Debug</span>
<br />
<span class="item has_right_arr">Big big<br/>Big world!</span>
<br/>
<span class="item has_right_skew">Big big<br/>Big everyone!</span>

CSS

.item {
    position: relative;
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 5px 25px;
    margin: 0 10px 10px 0;
}

.has_right_arr:after {
    position: absolute;
    display: block;
    content: '';
    top: 0;
    right: -15px;
    width: 30px;
    height: 50%;
    background: #000;

    -ms-transform: skew(45deg);
    -webkit-transform: skew(45deg);
    transform: skew(45deg);
}
.has_right_arr:before {
    position: absolute;
    display: block;
    content: '';
    bottom: 0;
    right: -15px;
    width: 30px;
    height: 50%;
    background: #000;

    -ms-transform: skew(-45deg);
    -webkit-transform: skew(-45deg);
    transform: skew(-45deg);
}
.has_right_skew:after {
    position: absolute;
    display: block;
    content: '';
    bottom: 0;
    right: -15px;
    width: 30px;
    height: 100%;
    background: #000;

    -ms-transform: skew(-25deg);
    -webkit-transform: skew(-25deg);
    transform: skew(-25deg);
}

.debug:after {
    background: rgba(255, 0, 0, 0.5);
}
.debug:before {
    background: rgba(255, 0, 0, 0.5);
}