This removes the need to know the width of the main DIV. Knowing the height is still necessary though...
.slope{
width:500px;
height:100px;
background:#0093f7;
text-align:center;
font-size:26px;
color:#fff;
vertical-align:middle;
overflow: visible;
position: relative; <--- this is important
}
.slope:after {
content: "";
position: absolute; <--- works with the above, such that positioning is relative to the main DIV
display: block;
right: -100px;
top: 0px;
width: 0px;
height: 0px;
border-top: solid 100px #0093f7;
border-right: solid 100px transparent;
}
Fiddle:
https://jsfiddle.net/vh1mk5yx/5/