Reputation: 31949
Is there a way how to automatically achieve this without the knowledge of line height/parent height with negative translate
?
Ideal solutions:
transform: translate(-100% of parent height or 1 line height here pls)
transform-origin: top left over bottom left
.parent {
margin-top: 100px;
border: 1px solid green;
border-left-color: red;
position: absolute;
}
.child {
border: 1px solid orange;
border-left-color: red;
transform: rotate(-90deg)/*translate(-20px)*/;
transform-origin: top left;
}
<div class="parent">
<div class="child">
CONCEPT
</div>
</div>
Upvotes: 1
Views: 1942
Reputation: 272901
You can try this:
.parent {
border: 1px solid green;
border-left-color: red;
margin-top:100px;
position:absolute;
}
.child {
border: 1px solid orange;
border-left-color: red;
transform: rotate(-90deg) translateY(100%);
transform-origin: bottom left;
}
<div class="parent">
<div class="child">
CONCEPT
</div>
</div>
Upvotes: 3
Reputation: 31949
OK, seems like the magic for me was in absolute position of the child. This way the parent shrinks to zero height where top-left corner becomes equal to bottom-left corner.
.child {
position: absolute;
}
This solution won't work however for parents that won't shrink due to other content.
Upvotes: 0