English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi,
I have a question relating to XML and CSS. I have an XML document like the one below and would like to know if there is a way of any kind to make the color of the words the way they are in CSS. That is, "red" would be in color red, "blue" would be in blue etc. I only want four lines of code in the CSS file. I have tried hours on end trying to find a way but to no avail. Any help would be greatly appreciated.
Thanks a million.

Here is the XML file:




Red

Olive
Blue

Black
Olive
Blue
Red
Black



Red
Black





Here is what I have so far with my CSS file:

a * b{color:blue;}
a,b,a{color:red;}

2006-06-20 15:23:30 · 2 answers · asked by eldiablo 1 in Computers & Internet Internet

2 answers

wow you have no idea how depressed i am that I cant answer this question. I love answering technical computer problems. kirupa.com all my Flash Artist friends might be able to help you on there. they are usually very familiar with all aspects of website design and all types of coding. goodluck my friend

2006-06-20 15:27:41 · answer #1 · answered by Oh, Natey-O! 3 · 0 1

it seems your tags are messed up or I messed up somewhere but for example there's no way you can get 2 different colors with the same tag one after the other like these 2 lines:
Red
Black

I also think that your CSS file is wrong. I don't know if the * operator exists in CSS, and the comma is used to combine tags (i.e. if you do " a,b{color:red} " then everything using the or tag will be in red).

The color will be overwritten by the inner most tag, so something like
blah will only take the color of and the color in will be discarded.

Here's a simple example you can start with, but you will not be able to get what you mentioned in the question. To my experience, I think each tag can only have one color, so there is no way you can have
redblack with both colors.

style.css (the css file):
a {color: red}
b {color: green}
c {color: blue}

test.xml (the xml file):



test1: red
test2: green
test3: blue




Notice that the inner tags take over the exterior tag when displayed in the browser.
Have fun with it
Cheers

2006-06-20 23:28:59 · answer #2 · answered by rice kid 4 · 1 0

fedest.com, questions and answers