puzzling <div> problem

Discussion in 'HTML' started by Richard, Sep 12, 2003.

  1. Richard

    Richard Guest

    <div class="parent">
    <div class="child1">
    <div class="child1a">
    xxx
    </div>
    </div>
    <div class="child2">
    <br>hello
    </div>
    </div>


    The problem is in "child2".
    In order for "hello" to show in the first line of the div tag, I need that
    damn break in there.
    Otherwise it doesn't show at all.
    If I insert an image, the top line is cut off regardless of height.
    I've tried various combinations in the definitions but can't figure this
    thing out.

    http://1-large-world.com/div1.html
     
    Richard, Sep 12, 2003
    #1
    1. Advertising

  2. Richard

    Richard Guest

    Never mind. Worked it out.
    Found out I forgot to include a } in the proper place.
    Oh well.
     
    Richard, Sep 12, 2003
    #2
    1. Advertising

  3. Richard

    Els Guest

    Richard wrote:

    > <div class="parent">
    > <div class="child1">
    > <div class="child1a">
    > xxx
    > </div>
    > </div>
    > <div class="child2">
    > <br>hello
    > </div>
    > </div>
    >
    >
    > The problem is in "child2".
    > In order for "hello" to show in the first line of the div tag, I need that
    > damn break in there.
    > Otherwise it doesn't show at all.
    > If I insert an image, the top line is cut off regardless of height.
    > I've tried various combinations in the definitions but can't figure this
    > thing out.
    >
    > http://1-large-world.com/div1.html


    Maybe you noticed, that the height of child2, is only 3
    times as high as the height of child1, but you specified it
    as 4 times as high. (child1: 25px, child2:100px) This is
    because child1 is positioned in front of child2. This
    explains the 'hello' being invisible; it is behind child1.
    Just change the style for div.child1 {position:absolute;} to
    {position:relative}, and it will appear as intended.


    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
     
    Els, Sep 12, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dfenestr8

    Puzzling form/cgi problem

    Dfenestr8, Nov 2, 2003, in forum: Python
    Replies:
    2
    Views:
    514
    Bengt Richter
    Nov 3, 2003
  2. George Sakkis

    Puzzling OO design problem

    George Sakkis, Apr 9, 2005, in forum: Python
    Replies:
    18
    Views:
    534
    George Sakkis
    Apr 11, 2005
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    776
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    207
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    334
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page