If you want the banner to rotate and lock in the left part of the browser window, you can use the transform-origin property. The default value is 50% 50%. This is 50% of the width and height of the element (center of the element).
You can try to set the origin to 0% 0%. what's the upper left corner of the banner, and then rotate it around that corner. Now, when the banner rotates, the origin becomes the bottom left corner of the banner. You can place it on the left side of the browser window as follows:
#side-banner { poition:fixed; left:0; top:50%; width:300px; margin-top:150px; transform: rotate(270deg); transform-origin:0% 0%; -ms-transform: rotate(270deg); -ms-transform-origin:0% 0%; -webkit-transform: rotate(270deg); -webkit-transform-origin:0% 0%; }
Edit:
If you want the banner to be the same height as the browser window after rotation, this can be done using javascript or jQuery. Like this:
var width = $(window).height(); var marginTop = Math.round(width / 2); $('#side-banner').css({ 'width': width, 'margin-top': marginTop });
cumul
source share