Search code examples
cssvertical-text

Is there a way to just rotate text vertically? Without rotating the whole cell?


I'm trying to do it using this:

.VerticalText {   
transform: rotate(-90deg); 
}

but it's rotating the text and cell. How do I just rotate the text vertically inside the cell?


Solution

  • You should make a div what is outside the text, and rotate that the other way.

    So: If

    .VerticalText {  
        transform: rotate(-90deg); 
    }
    

    and the div outside is called for example .VerticalTextWrapper

    .VerticalTextWrapper {
        transform: rotate(90deg);
    }
    

    Hope that helps!