我想旋转div,我希望它覆盖所有身体的宽度。所以我尝试将宽度设置为120%(显然100%是不够的)。然而,这个“解决方案”的问题在于我无法正确地将div对中。我应该如何解决这个问题?居中旋转的div内的文本div
这里是我试图使用代码:
* {
margin: 0;
padding: 0;
}
body {
background-color: yellow;
overflow-x: hidden;
}
.rotation {
position: relative;
display: table;
width: 120%;
height: 500px;
transform: rotate(-5deg);
background-color: green;
margin-left: -50px;
}
.wrapper {
display: table-cell;
vertical-align: middle;
margin: 0 auto;
text-align: center;
transform: rotate(5deg);
}
<h1>Some title</h1>
<div class="rotation">
<div class="wrapper">
<h1>Heading</h1>
<span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quo quaerat, dolore quod cum ea rerum asperiores cupiditate esse harum. Voluptatibus soluta fuga, beatae quod dolorem, veniam sint ab non laboriosam.</span>
</div>
</div>
您是否有参考图像,您想如何看?例如,“中心正确”是什么意思? – Hans