473,699 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot set background color (XML+CSS)

Hi all,

I have noticed that the background color of an XML document cannot be
set properly using CSS (that is, you cannot define styles for the BODY
element of an XHTML document).

I have an example of this:
www.houseofnerds.com/mathml_test.xml

Because I am trying to display MathML embedded in the page, I need to
use XML, so I cannot convert this to HTML via XSLT.

The above page renders fine in IE (ignore the giberrish that appears if
you do not have a MathML display plug-in. The important thing is that
it displays the background color as green) However, in Firefox (and I
assume Mozilla and Netscape), the background color is ignored, and it
is white??

Is there any way to acheive a different background color in both
browsers using XML + CSS?? Any other suggestions??

Jul 20 '05 #1
1 1397


mi************* **@hotmail.com wrote:

I have noticed that the background color of an XML document cannot be
set properly using CSS (that is, you cannot define styles for the BODY
element of an XHTML document).

I have an example of this:
www.houseofnerds.com/mathml_test.xml

Because I am trying to display MathML embedded in the page, I need to
use XML, so I cannot convert this to HTML via XSLT.


It is hard to tell what exactly is supposeded to happen with that
document as a complex XSLT stylesheet is applied to that input XHTML
with MathML document but in general if you want to set the background
color then try
html, body {
background-color: green;
}
as various browsers depending on their rendering mode have different
views on what constitutes the canvas so it is usually safer to set the
background color on both html and body element.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2

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

Similar topics

0
1360
by: Marek | last post by:
When I use "list-style-type:decimal;" in Mozilla I get numbering only with "zero": 0. aaaa 0. bbb 0. cccc Why there is no incrementation? In IE 6.0 there is no numbering: aaaa bbb cccc
2
1327
by: john schultz | last post by:
is there a standard file format that encapsulates some xml data and a stylesheet with which to display it in one file? ...and which doesn't require an internet connection. of course xml lets you reference a remote stylesheet with a url, but I'm looking for something that actually stores the stylesheet WITH the xml. any ideas?
0
1234
by: Chris | last post by:
We are looking for a highly experienced and extremely good PHP programmer to work on our PHP driven site. You will also need knowledge of XML and Mod Rewrite, CSS and javascript. We are UK based but are willing to try outsourcing. We can give you fulltime for at the very least a month or part-time (depending on hours and workrate). Our site is fairly complex and everything has been custom coded, no PEAR or Smarty etc, so you will need...
2
6279
by: michael_quinlivan | last post by:
Hi all, I have noticed that the background color of an XML document cannot be set properly using CSS (that is, you cannot define styles for the BODY element of an XHTML document). I have an example of this: www.houseofnerds.com/mathml_test.xml Because I am trying to display MathML embedded in the page, I need to
0
1223
by: Jon | last post by:
From: Michael Day <mikeday@yeslogic.com> Subject: Prince 5.0: XML + CSS to PDF formatter We are very happy to announce the release of Prince 5.0, a new version of our batch formatter for converting XML + CSS into PDF. - Even more CSS support - Even more PDF features - Quick and easy server integration
2
3947
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems there's no support for this. Either that or I'm doing something wrong. Well, enough venting, here's what I need. Using this sample XML file (test.xml):
1
1284
by: accyboy1981 | last post by:
Hi, I've create a web applicatation the create an xml document dynamically. Now that is does this I would like to add a stylesheet to the xml document. I'm using the following code: XmlDocument doc = new XmlDocument(); XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
6
1360
by: Dan H | last post by:
I'm trying to apply CSS to an XML file and interject a JavaScript function into the page. I have the following source code: foo.xml ====== <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="foo.css" type="text/css"?> <doc> <element1>
1
3113
by: jearnshaw | last post by:
Newbie Moment!! I hope you guys can help. I admit it I know NOTHING about xml and css. But I need to get a large amount of data out of xml and onto an intranet site which uses restricted html.I may be able to use css (if our new outsourced IT dept lets me) but I am having difficulty figuring out how to get the style sheets to do what i need. My page is as follows:
1
1084
by: sakthit | last post by:
If a list box is overlapping a page if u adjust the width of the list box then contents inside the list box got affected because of unlimited size.so how to use overlap attributes here. ive me with clear idea. thanks in advance
0
8687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9034
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8883
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7750
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.