IE using innerHTML with nested divs

Discussion in 'Javascript' started by withers, Oct 5, 2007.

  1. withers

    withers Guest

    The following code formats a NavBar correctly:

    1 <div class="pButton"><b>All information</b></div>
    2 <div id="NbNo87">
    3 <div class="pButton1" style="padding-left:.4em"> - Map</div>
    4 <div class="pButton1" style="padding-left:.4em"> - General
    information</div>
    5</div>
    6<div class="pButton"><b>Customer Services</b></div>
    7<div id="NbNo88">
    8 <div class="pButton1" style="padding-left:.4em"> - Wheels</div>
    9 <div id="NbNo89">
    10 <div class="pButton2" style="padding-left:.8em"> - Offer a lift</
    div>
    11 <div class="pButton2" style="padding-left:.8em"> - Book a lift</
    div>
    12 </div>
    13 <div class="pButton1" style="padding-left:.4em"> - Registration
    update</div>
    14 <div id="NbNo312"></div>
    15 <div class="pButton1" style="padding-left:.4em"> - Agent add</div>
    16 <div id="NbNo319"></div>
    17</div>
    18<div class="pButton"><b>Traders</b></div>

    The id=NbNoX are used by Javascript to insert buttons into the menu
    with innerHTML. This formats correctly in ?Firefox. But in IE6 and 7
    line 16 displays with a height of about 1em as if it had text in it,
    whereas lines 9 and 14 display correctly with a height of 0.

    Is this problem with IE or with me? Could anyone suggest a
    workaround?

    Thanking you in anticipation.
     
    withers, Oct 5, 2007
    #1
    1. Advertising

  2. withers

    Guest

    On Oct 5, 2:39 pm, withers <> wrote:
    > The following code formats a NavBar correctly:


    > The id=NbNoX are used by Javascript to insert buttons into the menu
    > with innerHTML.


    Plain straight HTML in the page would be easier to debug than
    innerHTML.

    You could also try using the IE Script Editor to tweak the style
    properties.

    This formats correctly in ?Firefox. But in IE6 and 7
    > line 16 displays with a height of about 1em as if it had text in it,
    > whereas lines 9 and 14 display correctly with a height of 0.
    >
    > Is this problem with IE or with me? Could anyone suggest a
    > workaround?
    >

    I'm guessing you have might have to set line-height: 0 on this.

    > Thanking you in anticipation.
     
    , Oct 6, 2007
    #2
    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. Guadala Harry

    Nested DIVs - is there a better way?

    Guadala Harry, Oct 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    Guadala Harry
    Oct 26, 2004
  2. rich
    Replies:
    0
    Views:
    724
  3. rwalrus
    Replies:
    10
    Views:
    166
  4. sonic
    Replies:
    5
    Views:
    293
    Randy Webb
    Jul 11, 2006
  5. maya
    Replies:
    4
    Views:
    243
Loading...

Share This Page