473,406 Members | 2,769 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.

DOM created content in IE not respecting stylesheet

69
Hi,

I've got a Javascript function to create some DOM content. The content is created fine in both IE and FireFox except that it FireFox it has styled the content according to the linked stylesheet, but in IE it has not.

Any ideas?

Regards,

Sean
Oct 24 '07 #1
6 1725
drhowarddrfine
7,435 Expert 4TB
Without a link or the complete code, anything we say would be just a wild guess.
Oct 24 '07 #2
acoder
16,027 Expert Mod 8TB
You posted this in the Articles section. Moved to the Forum section.
Oct 24 '07 #3
Sebarry
69
It's a bit difficult to supply the code as it's being developed internally. The code works fine on Firefox but in IE its not using the stylesheet. If I copied everything that has been generated, the generated source of the document into another HTML page it renders fine. So no changes to the code result in a perfect page when it is created in advance. It's only when the same content is created using the DOM that it doesn't render properly.

Without a link or the complete code, anything we say would be just a wild guess.
Oct 24 '07 #4
acoder
16,027 Expert Mod 8TB
Can you give some of the style rules that are not applied (or is it every rule)?
Oct 24 '07 #5
Sebarry
69
Hi,

This is the class that is used by the text that is not being styled.

Expand|Select|Wrap|Line Numbers
  1. .black11pxplain {
  2.     font-family:Arial, Helvetica, sans-serif;
  3.     font-size:11px;
  4.     line-height:14px;
  5.     color:#000000;
  6.     text-align:left;
  7. }
  8.  
It's included from an external file:

Expand|Select|Wrap|Line Numbers
  1. <link href="includes/main_styles.css" rel="stylesheet" type="text/css" />
And it's used as follows:
Expand|Select|Wrap|Line Numbers
  1. <td height="25" valign="middle" class="black11pxplain">Sub Heading</td>
  2.  
What's frustrating is that the HTML page is a mixture of static and dynamic content. The static content is rendered fine, it's the dynamic content that's not rendered according to the stylesheet. I've tried linking the stylesheet at runtime and again the static content gets rendered according to the stylesheet. I thought maybe it was not reapplying the stylesheet to what had been created at runtime using the DOM.

I'm lost.

Can you give some of the style rules that are not applied (or is it every rule)?
Oct 24 '07 #6
Are you setting classes using setAttribute?

If so you need to use setAttribute("classname", "name_of_class");
In internet explorer and setAttribute("class", "name_of_class"); for all the other web browsers
Oct 25 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Headless | last post by:
Should linking generated content work? Example: span:before{content:"foobar"} <a href="foobar.htm"><span></span></a> I stumbled across this bit in the CSS2 spec: >Generated content does...
7
by: Vincent van Beveren | last post by:
Hi everyone I have a JavaScript app that creates an IFRAME through DOM (createElement('IFRAME')) However, that IFRAME does not have any content yet. ...
3
by: jnm | last post by:
How can I avoid the content of <meta name="Microsoft Border" content="b, default"> is printed, when printing by means of <link rel="stylesheet" href="../print.css" type="text/css"...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
7
by: pushpadant | last post by:
Hi, I have one master page which has some table inside one of the <td> i have my contentplaceholder. on the <head> tag of the master page i have specified link to a global CSS...
4
by: cathy | last post by:
Hi All, I am having problems displaying content relevant to the option selected in a drop-down menu. I have an xml document which is running content through Flash and I need to have the same...
8
by: Amit | last post by:
I have a master page and a content page but the stylesheet isnt getting applied like how it looks in visual studio design view. The master page is defined like this: <%@ Master Language="VB"...
1
by: erictomlinson | last post by:
I'm dying here trying to figure this out for days. Here's the scenario: 1) External script.as file dynamically imported to loader.swf file that creates a textfield (createTextField) 2)...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.