View Full Version : positioning in element

12-20-2005, 04:53 AM
I have an element with 3 divs inside. I want the left div on the left. The middle div is text and I want it centered and the right div is an image log I want on the right. What's the best way to do this?

12-20-2005, 05:17 AM
well there are alot of variables in this.

Do you want to have the containing element have a fixed width or should it scale?

Do any of your columns scale or are they all fixed width?

Do they have fixed heights at all or do they expand to fit the content in each? If they expand vertically do you want all the columns to appear the same length?

A little more specific as to what your end goal is can result in a better example. But for starters you can look at this and see how it works for you:

<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
#element {
border: 2px solid #f3c;
#left {
float: left;
width: 200px;
height: 300px;
background-color: #ccc;
#right {
float: right;
width: 200px;
height: 300px;
background-color: #666;
#center {
margin-left: 200px;
margin-right: 200px;
height: 300px;
background-color: #333;
<div id="element">
<div id="left"></div>
<div id="right"></div>
<div id="center"></div>

the left and right columns ahve fixed widths. the center scales to fit.

12-20-2005, 04:55 PM
Thanks for the reply... Just enough to get this beginner going!

Your help is greatly appreciated!