Found the solution while I was typing. The problem was, that I forgot to add one of the following css definitions:
display: block;
display: inline-block;
display: inline-flex;
After adding a definition to the style, the text got rotated correctly.