DIV

Discussion in 'HTML' started by wombat, Feb 8, 2007.

  1. wombat

    wombat Guest

    Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.

    What I have been trying to do is use DIV to force output to scroll if it
    exceeds the given height and width of the TD that contains the DIV. The
    TD is 50% of the screen in both height and width and I tried using
    overflow: scroll for the DIV tag but the output is still pushing the
    size of the TD beyond what I had it set for (and the scroll bar for the
    DIV tag still appears as it's supposed to with its overflow setting). Is
    it possible to force DIV to not push the height and width settings for
    the TD?
     
    wombat, Feb 8, 2007
    #1
    1. Advertising

  2. wombat wrote:
    > Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.
    >
    > What I have been trying to do is use DIV to force output to scroll if it
    > exceeds the given height and width of the TD that contains the DIV. The
    > TD is 50% of the screen in both height and width and I tried using
    > overflow: scroll for the DIV tag but the output is still pushing the
    > size of the TD beyond what I had it set for (and the scroll bar for the
    > DIV tag still appears as it's supposed to with its overflow setting). Is
    > it possible to force DIV to not push the height and width settings for
    > the TD?



    URL?

    Maybe you should be using a table to begin with. Does the table cells
    have padding, borders? Table have borders collapsed? Who knows what your
    problem is since we have no evidence.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Feb 8, 2007
    #2
    1. Advertising

  3. wombat

    Ben C Guest

    On 2007-02-08, wombat <> wrote:
    > Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.
    >
    > What I have been trying to do is use DIV to force output to scroll if it
    > exceeds the given height and width of the TD that contains the DIV. The
    > TD is 50% of the screen in both height and width and I tried using
    > overflow: scroll for the DIV tag but the output is still pushing the
    > size of the TD beyond what I had it set for (and the scroll bar for the
    > DIV tag still appears as it's supposed to with its overflow setting). Is
    > it possible to force DIV to not push the height and width settings for
    > the TD?


    Setting height and width on the DIV (and overflow: scroll) should do it.

    But you need to set them to actual values, not percentages, which is not
    what you want.

    I don't see why percentages shouldn't work (after all the dimensions of
    the containing block are resolvable), but they don't in Opera, Firefox or
    Konqueror.

    The other option is not to use a <td>, what's the context?
     
    Ben C, Feb 8, 2007
    #3
  4. wombat

    Roy A. Guest

    On 8 Feb, 22:15, Ben C <> wrote:
    > On 2007-02-08, wombat <> wrote:
    >
    > > Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.

    >
    > > What I have been trying to do is use DIV to force output to scroll if it
    > > exceeds the given height and width of the TD that contains the DIV. The
    > > TD is 50% of the screen in both height and width and I tried using
    > > overflow: scroll for the DIV tag but the output is still pushing the
    > > size of the TD beyond what I had it set for (and the scroll bar for the
    > > DIV tag still appears as it's supposed to with its overflow setting). Is
    > > it possible to force DIV to not push the height and width settings for
    > > the TD?

    >
    > Setting height and width on the DIV (and overflow: scroll) should do it.
    >
    > But you need to set them to actual values, not percentages, which is not
    > what you want.
    >
    > I don't see why percentages shouldn't work (after all the dimensions of
    > the containing block are resolvable), but they don't in Opera, Firefox or
    > Konqueror.


    Yes, the dimensions of the containing block are resolvable, but who
    should resolve it? You or the browser?

    The initial value for the height property is auto. For most containing
    blocks this means 0.

    http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-height

    What auto means for the initial containing block is also specified.

    "The height of the initial containing block may be specified with the
    'height' property for the root element. If this property has the value
    'auto', the containing block height will grow to accommodate the
    document's content."

    http://www.w3.org/TR/REC-CSS2/visuren.html#containing-block

    And since the height property is auto for "all elements but non-
    replaced inline elements, table columns, and column groups", that
    means that Opera, Firefox and Konqueror does what you could expect.

    Just specify the height of the initial containing block and any
    subsequent containing blocks:

    html, body, ... { height: 100% }
     
    Roy A., Feb 9, 2007
    #4
  5. wombat

    Ben C Guest

    On 2007-02-09, Roy A. <> wrote:
    > On 8 Feb, 22:15, Ben C <> wrote:
    >> On 2007-02-08, wombat <> wrote:
    >>
    >> > Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.

    >>
    >> > What I have been trying to do is use DIV to force output to scroll if it
    >> > exceeds the given height and width of the TD that contains the DIV. The
    >> > TD is 50% of the screen in both height and width and I tried using
    >> > overflow: scroll for the DIV tag but the output is still pushing the
    >> > size of the TD beyond what I had it set for (and the scroll bar for the
    >> > DIV tag still appears as it's supposed to with its overflow setting). Is
    >> > it possible to force DIV to not push the height and width settings for
    >> > the TD?

    >>
    >> Setting height and width on the DIV (and overflow: scroll) should do it.
    >>
    >> But you need to set them to actual values, not percentages, which is not
    >> what you want.
    >>
    >> I don't see why percentages shouldn't work (after all the dimensions of
    >> the containing block are resolvable), but they don't in Opera, Firefox or
    >> Konqueror.

    >
    > Yes, the dimensions of the containing block are resolvable, but who
    > should resolve it? You or the browser?
    >
    > The initial value for the height property is auto. For most containing
    > blocks this means 0.


    You right, I was overlooking the fact that the body's height is auto.

    [...]
    > Just specify the height of the initial containing block and any
    > subsequent containing blocks:
    >
    > html, body, ... { height: 100% }


    Exactly, and this confirms what's going on.
     
    Ben C, Feb 9, 2007
    #5
  6. wombat

    wombat Guest

    In article <>,
    Ben C <> wrote:

    > On 2007-02-08, wombat <> wrote:
    > > Ok, since IFRAME didn't work for me.. I'm back to trying to use DIV.
    > >
    > > What I have been trying to do is use DIV to force output to scroll if it
    > > exceeds the given height and width of the TD that contains the DIV. The
    > > TD is 50% of the screen in both height and width and I tried using
    > > overflow: scroll for the DIV tag but the output is still pushing the
    > > size of the TD beyond what I had it set for (and the scroll bar for the
    > > DIV tag still appears as it's supposed to with its overflow setting). Is
    > > it possible to force DIV to not push the height and width settings for
    > > the TD?

    >
    > Setting height and width on the DIV (and overflow: scroll) should do it.
    >
    > But you need to set them to actual values, not percentages, which is not
    > what you want.
    >
    > I don't see why percentages shouldn't work (after all the dimensions of
    > the containing block are resolvable), but they don't in Opera, Firefox or
    > Konqueror.
    >
    > The other option is not to use a <td>, what's the context?


    Yep I tried all that, everything down to the BODY I had set to 100%
    except for the containing TD which was set at 50% (there was a TD below
    it at 50%), and the DIV in the upper TD was set at 100%.. still it
    pushed the cel below it and beyond the bottom of the browser. I've since
    switched to using frames. Not what I wanted, but have to defeat this
    monster. Thanks.
     
    wombat, Feb 10, 2007
    #6
    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. Josef K.

    <label><div></div></label> allowed?

    Josef K., May 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    13,557
    Josef K.
    May 22, 2005
  2. Jim in Arizona

    <div id="help" runat="server"></div>

    Jim in Arizona, Nov 17, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    12,576
    Kevin Spencer
    Nov 17, 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:
    208
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    334
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page