h1 {
font-size: 30px;
position: relative;
display: table;
}
h1:before, h1:after {
content:'';
display: block;
width: 30px;
height: 5px;
position: absolute;
transform: rotate(-45deg);
}
h1:before {
top:0;
left:-20px;
background:#f00;
}
h1:after {
bottom:0;
right:-20px;
background:#0f0;
}