473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

IE using innerHTML with nested divs

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.

Oct 5 '07 #1
2 2732
withers said the following on 10/5/2007 5:39 PM:
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.
First suggestion would be to post a URL to a sample page that displays
the problem. Second suggestion would be not to post line numbers as that
makes it more trouble than it is worth to copy/paste into a new file.
Make sure your posted code includes any/all JS that is associated with
it as well as the CSS code that is associated with it.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 5 '07 #2
On Oct 5, 2:39 pm, withers <ro...@upperbridge.co.ukwrote:
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 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dustin | last post by:
Here's what I am trying to do: (Names represent CSS classes.) I want to create a photo gallery. I want the entire gallery to be surrounded by a box named PhotoGallery. I want a fluid placement...
3
by: Philip | last post by:
I am trying to make a bunched of left-floated divs that will be contained in a larger div. the floated divs all contain a left-floated img and text of varying sizes. If I don't set a height (or...
10
by: rwalrus | last post by:
Getting an "unknown runtime error code 0" in IE6 on the last two lines of the function below. Works fine in Firefox 1.5, I can't figure out what IE is complaining about. Both "subtotal" and...
1
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
3
by: xscape | last post by:
Hi all, I have an XML file which contains a load of nested divs. I'm trying to write some XSL to create a new XML file with all the excess divs removed, but I want to retain the content and place...
2
by: Ben C. | last post by:
Hi If I have a container div and inside the container div I float two divs (one left and one right), the containting div will collapse as the floated divs will no longer prop it up, meaning that...
2
by: Mike | last post by:
Can someone please explain how onclick works with nested, absolutely positioned div containers? I would expect, when several divs are on top of one another, clicking on them would trigger an...
24
by: Chris F.A. Johnson | last post by:
On 2008-07-09, Denis McMahon wrote: If the left-hand column contains any text, use em rather than px to size it. In CSS, less is more. Most problems are caused by specifying too much rather...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.