Reputation: 105
How to start the text from bottom to Top?
I Need:
I tried:
.rotated {
writing-mode: tb-rl;
transform: rotateZ(-270deg);
}
<div class="rotated">
<span>5000</span><br>
<span>3000</span><br>
<span>2000</span><br>
<span>1000</span>
</div>
Using
<br />
it can be solved easily, but it will be of no used when the screen is small and<div>
isposition: fixed;
.
Upvotes: 3
Views: 836
Reputation: 4142
Just change the order of adding items and use flex like this:
.rotated {
display: flex;
height: 300px;
flex-direction: column-reverse;
}
<div class="rotated">
<span>1000</span>
<span>2000</span>
<span>3000</span>
<span>5000</span>
</div>
Upvotes: 1
Reputation: 1102
You can use flexbox (display: flex
) with align-items: flex-start
and justify-content: flex-end
.
.rotated {
display: flex;
align-items: flex-start;
justify-content: flex-end;
flex-direction: column;
/* For demo */
border: 1px solid black;
height: 200px;
width: 200px;
}
<div class="rotated">
<span>5000</span><br>
<span>3000</span><br>
<span>2000</span><br>
<span>1000</span>
</div>
Upvotes: 0