html - Two div elements, one fixed and the other one is auto. How to fix? -


i have total brain freeze , appreciate helping hand how fix it.

i have 2x div elements. called left , right:

i want right element have fixed width of 320px, , left 1 should auto. when shrink browser window, left element should become smaller.

i can working if left element fixed, not right one.

working code left:

.left {width: 320px;float: left;background:#ccc;} .right { margin-left: 320px; background:#ffff00; } 

not working code right:

.left_two { margin-right: 320px; background:#ffff00; } .right_two {width: 320px;float: right;background:#ccc; } 

but how want behaive.

you can follow code , project here: ( shrink browser window )

http://www.adamskymotorkylare.se/project/new.php

thanks jack

change html structure like this

<div class="left">left</div> <div class="right">right</div>  <div class="right_two">right</div> <div class="left_two">left</div> 

demo


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -