Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > IE using innerHTML with nested divs

Reply
Thread Tools

IE using innerHTML with nested divs

 
 
withers
Guest
Posts: n/a
 
      10-05-2007
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.

 
Reply With Quote
 
 
 
 
dhtmlkitchen@gmail.com
Guest
Posts: n/a
 
      10-06-2007
On Oct 5, 2:39 pm, withers <ro...@upperbridge.co.uk> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
swapping divs -- when divs NOT positioned absolutely.. maya Javascript 4 11-16-2007 05:11 PM
xhtml, innerHtml, appendChild, and innerHTML. what is the exact proper way to do this with DOM sonic Javascript 5 07-11-2006 08:17 AM
divs, innerHTML and unknown runtime errors rwalrus Javascript 10 02-17-2006 06:53 PM
Managing divs within divs.... rich HTML 0 02-02-2006 07:38 PM
Nested DIVs - is there a better way? Guadala Harry ASP .Net 2 10-26-2004 07:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57