473,395 Members | 1,679 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,395 software developers and data experts.

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 1385


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
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
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...
0
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...
2
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...
0
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...
2
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...
1
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: ...
6
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"?>...
1
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...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.