Since the height of the arrow is known, you can simply use a value top 50%and then negative margin-topto offset the height of the arrow:
An example here is now working for dynamic content.
#mybox:after {
content:"";
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
position: absolute;
border-left: 20px solid #f00;
width: 0;
height: 0;
right: -20px;
top: 50%;
margin-top: -20px;
}
Alternatively, if the height of the arrow is unknown, you can use the following:
#mybox:after {
top: 50%;
-webkit-transform: translate(0, -50%);
transform: translate(0, -50%);
}