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);} 

enter image description here

  1. wrap div around gray box , sidebar position:relative.
  2. center align gray box with:

    width:100%; margin: 0px auto; display: block;

  3. apply sidebar:

    position: absolute; right:-30px;

a piece of advice, css learnt better playing it.


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -