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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Two div tags even

    Kind of a simple question, I suppose. But, how do you make two div tags horizontally the same. Like have the sidebar be even with the main content div. Whenever I try to do this, they just end up being stacked vertically.

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    it would be of great help to see your code but, as a guess, have you tried floating the earlier div to the left so that other one can come up to the right of it (subject to width dimensions). You may have to float one 'left' and the other 'right'.

    perhaps like this

    <div id="firstDiv">text etc in here</div>
    <div id="secondDiv">text etc in here</div>

    then your css might be like this:

    #firstDiv, #secondDiv {
    attributes, common to both, here
    }

    #firstDiv{
    float : left;
    }

    #secondDiv {
    float : right;
    }

    bazz
    Last edited by bazz; 09-19-2007 at 11:25 PM. Reason: adding a bit of code

  • #3
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, when I do that, it makes the height of that div tag 0, and screws everything up. I don't want to statically set the height of it, as I want it to dynamically change with the content.

    Here's a link:
    http://rafb.net/p/5li9PS15.html

  • #4
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    okay your going to need to set a width (either % or actuall width [px etc...] of one of the divs (usually the non floated one if its a sidebar sort of deal) height wise the divs will expand to the content in them.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #5
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll just ask in here.

    http://gmu.awardspace.com/

    On that site, how would I get the navigation bar on the left to have the same height as the main text area (The white part)?


  •  

    Posting Permissions

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