Thursday, August 21st, 2008

Quick CSS quiz

Filed under: Science and Technology — Daniel Lemire @ 21:49

Given these CSS instructions,


z[x] > a[i] {color: blue;}
z z[x] a {text-decoration: underline;}
z > z a , z z z + a { color: red ;}

what will be the color of the text in the following XML file?

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/css"
href="test.css"?>
<z><z x="x">
<z />
<a i="x">my text</a>
</z>
</z>

3 Comments »

  1. Without trying it (which would be cheating)… blue?

    Comment by Stephen Downes — 22/8/2008 @ 5:52

  2. ;-)

    Comment by Daniel Lemire — 22/8/2008 @ 6:12

  3. Wow, and I thought I had a good understanding of CSS! I didn’t know you could apply it to XML and I don’t recognize half of that syntax! I am going to guess blue though since the first rule appears to be a more fine grained rule

    Comment by Sean McGrath — 22/8/2008 @ 8:53

RSS feed for comments on this post.

Leave a comment

Warning: When entering a long comment, please ensure that you make copy of your text prior to submitting it. If the server should fail or if you hit a bug, you might lose your work. I am not responsible for your lost effort.

To spammers: I carefully review every single post and make sure that spam gets deleted. You are wasting your time if you are manually entering spam using this form. Read my terms of use to see what I consider to be abusive.

Example: I + II + IX= XII. Yes, you have to enter a roman numeral. (Answer must be in upper case.)

« Blog's main page

26 queries. 0.342 seconds. Valid XHTML

Powered by WordPress

Subscribe to this blog in a reader or by Email.