html - Vertical placement of an image is taking my div out of flow of document -
i trying place image vertically on left side of screen (not vertical alignment in div).
i have achieved using transform: rotate(270deg)
, put property transform
in css, taking div
out of flow. used position (top, left, bottom, right)
, used crazy values -1800px
... bring div
(with image) wanted (left side, vertically)
the problem is, when zoom out, page looking ugly. can please suggest me way keep vertically place image, still prone zoom in or zoom out
html:
<div class="leftsidelogo"> <h1>left side logo</h1> <img src="images/google_logo.png" alt="logo" /> </div>
css:
.leftsidelogotest { float: left; width: 15%; transform: rotate(-90deg); transform-origin: top top; transform-style: preserve-3d; background-color: red; background-image: url("../images/google_logo.png"); background-size: 100% 100%; background-repeat: no-repeat; background-position: left center; } .leftsidelogo { //float: left; background-color: red; width: 100%; height: 130%; position: absolute; top: 375px; left: -500px; background-image: url("../images/google_logo.png"); background-size: 70% 70%; background-repeat: no-repeat; background-position: center; transform: rotate(-90deg); //transform: scale(1,1); //z-index: +1; } .leftsidelogo img { height: 100px; width: 80%; position: absolute; top: 30px; }
is trying get? see demo follows (and comments inside).
body { margin: 0; } .left-logo { background: url("//dummyimage.com/200x50") 0 0 no-repeat; width: 200px; /*max value of image size*/ height: 200px; /*max value*/ position: absolute; /*or fixed*/ left: 0; top: 0; transform: rotate(-90deg); } .main-area { background: gold; margin-left: 50px; /*min value*/ }
<div class="left-logo"></div> <div class="main-area">main area</div>
jsfiddle: http://jsfiddle.net/7epwvjho/
Comments
Post a Comment