Reputation: 3011
I have this layout: (also a JSFiddle here)
.rotate {
transform: rotate(270deg) translate(-10em, 0);
transform-origin: 0 0;
float: left;
}
.left {
float: left;
}
<div class='rotate'>
Rotated
</div>
<div class='left'>
Some content....
<br> Some content....
<br> Some content....
<br> Some content....
<br> Some content....
<br>
</div>
I am trying to get the .rotate
div to be right next to the .left
div, however I can't.
I've tried...
position:absolute
and left:0
, but then that overlaps the contentHow do I get a div to rotate alongside a left-floated div?
Upvotes: 0
Views: 561
Reputation: 3675
Just change the transform-orgin
of the rotated div and also remove the translate
from that element.
.rotate {
transform: rotate(270deg);
transform-origin: 100% 100%;
float:left;
}
.left {
float: left;
}
<div class='rotate'>
Rotated
</div>
<div class='left'>
Some content....
<br> Some content....
<br> Some content....
<br> Some content....
<br> Some content....
<br>
</div>
Upvotes: 2