作者:智勇双全882602900857_984 | 来源:互联网 | 2023-09-12 09:24
I don't get it ;-(
我不明白;-(
I want to center a div with a text contained in another div. The inner div is rotated by 90 degres. So far so good. My problem is that I can't get the inner div to align horizontal to the left of the outer div. How can this be done?
我想将div与另一个div中包含的文本居中。内部div旋转90度。到现在为止还挺好。我的问题是我不能让内部div在外部div的左边水平对齐。如何才能做到这一点?
Here is the fiddle
这是小提琴
HTML:
CSS:
div {
border: 1px solid red;
}
.outer {
position: absolute;
top: 0px;
height: 300px;
width: 30px;
}
.inner {
transform: translateX(-50%) translateY(-50%) rotate(90deg);
margin-left: 10px;
position: relative;
top: 50%;
text-align: center;
}
3 个解决方案