I'm currently struggling with a layout problem. I'd like to create a rotated div with a text inside it, but the text should not be rotated; I'd like the text to be aligned to the left side but keep the edge of the rotated div.
Here's the simplified version of what I've tried so far:
.container {
background-color: green;
width: 200px;
height: 300px;
transform: rotate(30deg);
position: relative;
}
.text {
background-color: red;
color: white;
transform: rotate(-30deg);
}
<div class="container">
<div class="text">
<p>
This is some text.
</p>
<p>
And here's the second paragraph.
</p>
</div>
</div>
What I'd like to have is the second paragraph to be aligned to the left side of the rotated div.
The desired effect:
Is it possible with CSS or should I somehow try with JS?
