jquery - Keep a div spaced exactly X amount of pixels away from another -
i'm trying keep sidebar div 30px grey box always, during resize. problem i'm running whitespace:nowrap. seems mess left:79% rule. however, if remove text wraps.
https://jsfiddle.net/yzm83d6d/
#sidebar-miniright { width:100%; white-space:nowrap;} .sidebar-right { position: fixed; top: 50%; left:79%; /* safari */ -webkit-transform: rotate(-270deg); /* firefox */ -moz-transform: rotate(-270deg); /* ie */ -ms-transform: rotate(-270deg); /* opera */ -o-transform: rotate(-270deg); transform: rotate(-270deg);}
- wrap
div
around gray box , sidebarposition:relative
. center align gray box with:
width:100%; margin: 0px auto; display: block;
apply sidebar:
position: absolute; right:-30px;
a piece of advice, css learnt better playing it.
Comments
Post a Comment