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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    104
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Iframe Div Overlapping issue

    Hello Can some one help me with a problem Problem with my iframe div overlapping another div.
    http://screencast.com/t/uFdidurNxC


    PHP Code:
    <div class="iframe1">
    <
    iframe src="image_upload/main/index.php?test=21" id="MyFrame" 
    frameborder="0" marginheight="0" marginwidth="0" 
    width="900px" height="900px" scrolling="auto"></iframe
    <
    div>
    <
    div class="clear">&nbsp;</div>
    <
    div id="adcanvas" class="bldtxt">Place Ad</div

    css for both

    PHP Code:

    #adcanvas {
        
    background-color:#c6c7c9;
        
    width:900px;
        
    margin:20px;
        }

    .
    iframe1 {
        
    height:100px;
        
    margin-bottom:5px;
        } 

    How can I get the other div to just move down instead of it over lapping



    Please advise..

    Thanks, Dan

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    try setting a z-index: 1; to the element you want behind and a z-index: 2; to the element you want in front.

    if that doesn't work, add position: relative; to the element you want in front

    Code:
    /* front */
    z-index: 2;
    position: relative;
    
    /* behind */
    z-index: 1;

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Posts
    104
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Thanks Sammy for the reply but what if you want them both even, meaning no overlapping under or over?

    When I do it the way you suggested I get this as a result

    http://screencast.com/t/djNLbrgFPZ
    Last edited by dk4210; 11-02-2011 at 12:48 AM.

  • #4
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    you mean you want the "place ad" in front of the other, but you want it transparent?

    or do you want place ad below the bordered element?

  • #5
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,341
    Thanks
    11
    Thanked 288 Times in 287 Posts
    Quote Originally Posted by dk4210 View Post
    Hello Can some one help me with a problem Problem with my iframe div overlapping another div.
    http://screencast.com/t/uFdidurNxC


    PHP Code:
    <div class="iframe1">
    <
    iframe src="image_upload/main/index.php?test=21" id="MyFrame" 
    frameborder="0" marginheight="0" marginwidth="0" 
    width="900px" height="900px" scrolling="auto"></iframe
    <
    div>
    <
    div class="clear">&nbsp;</div>
    <
    div id="adcanvas" class="bldtxt">Place Ad</div

    css for both

    PHP Code:

    #adcanvas {
        
    background-color:#c6c7c9;
        
    width:900px;
        
    margin:20px;
        }

    .
    iframe1 {
        
    height:100px;
        
    margin-bottom:5px;
        } 
    How can I get the other div to just move down instead of it over lapping
    I haven't tested, but in your iframe you're declaring the height to be "900px" (by the way, remove the "px" from that and the width of the iframe), and in your class .iframe1 you declare the height to be 100px. My guess is the second div is sitting right below the 100px height. So change the class to be 900px like your iframe and see if that works.

    Dave

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Posts
    104
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Hi Track nut!

    I tried that and it still did not work for me.. I don't want to change the .iframe1 to 900px because it would make the height too much(tested it). I want the height of the div to be 100px. I just want the bottom div to move when the iframe1 div expands and not overlap.

  • #7
    Regular Coder
    Join Date
    Nov 2002
    Posts
    104
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Sammy,

    No I want this



    ------------------------------------------------------
    . .
    . .iframe1(div) .
    ------------------------------------------------------

    As .iframe1 div expands it pushes the .adcanvas div downward

    |
    |
    \/

    ------------------------------------------------------
    - -
    - .adcanvas(div) -
    ------------------------------------------------------

  • #8
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,341
    Thanks
    11
    Thanked 288 Times in 287 Posts
    PHP Code:
    width="900px" height="900px" scrolling="auto"></iframe

    I don't want to change the .iframe1 to 900px because it would make the height too much(tested it). I want the height of the div to be 100px.
    So I must be confused then. If you want it 100px, what is the purpose of the frame size height setting to "900px"?

    Do you have this code online somewhere that we can see the actual page?

    Dave


  •  

    Posting Permissions

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