V
vunet
I want to position 2 divs correctly. First one is the content and
second one is the right side bar of fixed size.
I want the content to have no fixed width but right side bar would be
200px. If no right side bar div tag shown, the first div would fully
expand.
Please recommend based on my bad example below or suggest something
better if possible.
The example below has a fixed width for div 2, but I need full width
and div 2 would fit in on right side moving div 1 content to the left.
Thanks a lot
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}
div#one {
float: left;
width:300px;
margin: 0px;
background-color: red;
}
div#two {
float: right;
width: 200px;
padding: 5px;
margin: 0px;
background-color: silver;
}
-->
</style>
</head>
<body>
<div id="one">
Port side text...
<p>Eu fugiat nulla pariatur. Velit esse cillum dolore duis aute
irure dolor ut aliquip ex ea commodo consequat. </p>
</div>
<div id="two">
Second column text...
<p>Velit esse cillum dolore duis aute consectetur adipisicing
elit. Quis nostrud sed tempor est laborum. </p>
<p>Sed do eiusmod tempor incididunt sunt in culpa consectetur
adipisicing elit. Excepteur sint occaecat eu fugiat nulla pariatur. Eu
fugiat nulla pariatur. Ut labore et dolore magna aliqua. </p>
</div>
</body>
</html>
second one is the right side bar of fixed size.
I want the content to have no fixed width but right side bar would be
200px. If no right side bar div tag shown, the first div would fully
expand.
Please recommend based on my bad example below or suggest something
better if possible.
The example below has a fixed width for div 2, but I need full width
and div 2 would fit in on right side moving div 1 content to the left.
Thanks a lot
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
}
div#one {
float: left;
width:300px;
margin: 0px;
background-color: red;
}
div#two {
float: right;
width: 200px;
padding: 5px;
margin: 0px;
background-color: silver;
}
-->
</style>
</head>
<body>
<div id="one">
Port side text...
<p>Eu fugiat nulla pariatur. Velit esse cillum dolore duis aute
irure dolor ut aliquip ex ea commodo consequat. </p>
</div>
<div id="two">
Second column text...
<p>Velit esse cillum dolore duis aute consectetur adipisicing
elit. Quis nostrud sed tempor est laborum. </p>
<p>Sed do eiusmod tempor incididunt sunt in culpa consectetur
adipisicing elit. Excepteur sint occaecat eu fugiat nulla pariatur. Eu
fugiat nulla pariatur. Ut labore et dolore magna aliqua. </p>
</div>
</body>
</html>