Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    positioning in element

    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?

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    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:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>testing</title>
    <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;
    }
    </style>	
    </head>
    <body>
    <div id="element">
    <div id="left"></div>
    <div id="right"></div>
    <div id="center"></div>
    </div>
    </body>
    </html>
    the left and right columns ahve fixed widths. the center scales to fit.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply... Just enough to get this beginner going!

    Your help is greatly appreciated!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •