html - Three divs next to each other, third fixed position -


i have 3 divs, should next each other third 1 needs fixed @ position. tried using right:0, float:right in these cases third div doesn't stick other two, instead sticks right browser side, not want. have javascript move depending on calculated browser window width or there html/css (perhaps bootstrap) way it?

i have following html:

        <div id="sub-container">             <div id="left">                 {left}             </div>             <div id="content">                 {content}             </div>             <div id="right">                 {right}             </div>         </div> 

and such css:

#left {     float:left;     top:$topbarheight;     width:$leftwidth;     position:relative;     margin:2px auto;     min-height:600px;     z-index:1;  }  #right {     width:$rightwidth;     height:604px;     top:$topbarheight;     position:fixed;     margin-left: 10px; }  #sub-container {     position:relative;     float:left;     max-width:724px;     margin:auto;     clear: both; }  #content {     position:relative;     top:$topbarheight;     float:left;     max-width:600px; } 

if change right div's position absolute rather fixed, move right distance respective subcontainer rather browser.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -