html - Two divs, static div on the left side and fluid div on the right side -


here's situation:

   .left {         float: left;         width: 150px;         height: 300px;         margin-right: 20px    }    .right {         float: right;         max-width: 450px;         height: 300px;    } 

i want right div fluid, when comes decreasing width of browser has still on right side of screen, smaller width.

but right div quite rude. instead of doing i'm telling him do, treats width priority. when window touching right edge, he's jumping below poor left div instead of decreasing width.

do guys know way punish him? tell him behavior isn't right? make him stay on right side of screen?

thanks in advice!

try following , should you're looking for.

    .left {         float: left;         width: 150px;         height: 300px;         margin-right: 20px;         border:1px solid black;    }   .right {         max-width: 450px;         height: 300px;         border:1px solid black;         margin-left:155px;    } 

if remember correctly, floated div's cant have auto widths. since left div has static width, can push right div margin clears left div , fluid.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -