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

    CSS/DIV Position 2 layers in the same place

    Re: https://secure.glxhost.com/order/new.cgi?package=1

    I am trying to create a button which switches a DIV layer to visible or not- so that the customer can either have a "NEW CUSTOMER" or "EXSITING CUSTOMER" box to use.

    I've got this to work great by using two <DIV>'s, and using javascript to set them visible or not.

    The problem is, the first box on the page will take up a lot of room, pushing the second DIV further down the page.
    I would like both divs to start in the same place.
    I was planning to use POSITION:ABSOLUTE, however, the position is not absolute, because the content above it could change.
    How do i tell two DIV layers to position themselves at the top of a table?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    You could possibly use position:relative

    Take a look at these 2 example divs they are both in the same place

    <div style="width:100px;height:25px;border:1px solid red">Hello World</div>
    <div style="position:relative;top:-25px;width:120px;height:25px;border:1px solid blue">Hello World</div>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

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