I want to have effect with div where left div is 100% and right stay fixed
<!DOCTYPE html>
<html>
<style>
.left {
width: 100%;
float: left;
border: #ccc solid 1px;
}
.right {
width: 50px;
float:left;
border: #987 solid 1px;
}
.main {
border: #666 solid 1px;
margin: 0px auto;
}
.clear {
clear:both;
}
</style>
<body>
<div class="main">
<div class="left">
</div>
<div class="right">
</div>
<div class="clear"></div>
</div>
</body>
</html>
I know I could use table to achieve this easy, but how can I achieve this with div’s
You mean this?:
http://jsfiddle.net/JPPaf/
If you’re going to use borders nest another div inside and apply borders to that inner div since it will save you alot of problems.