有没有办法在不知道行高/父高为负translate
的情况下自动实现这一目标?
理想的解决方案:
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>
答案 0 :(得分:2)
您可以尝试以下方法:
.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>
答案 1 :(得分:0)