Forum How do I...?

content:url stuff

Ben
I found some strange behavior:
When I use the css
.iconpic {
  content: url("imgs/icon.png");
}


The url uses the basepath of the CSS for the url.
However, if I use
.iconpic {
  content:attr("graphic", url);
}


And specifiy a graphic attribute in the tag in the XML document, the url uses the basepath of the XML. I don't know if this is regular functionality, but I could see why it could be neat. Is it documented anywhere?
Ben
mikeday
This is definitely a feature, not a bug :D

The general principle is that URLs should be resolved relative to the base URL of whichever document they appear in, whether it is XML or CSS.

In previous versions, Prince incorrectly resolved relative URLs within CSS style sheets; the URL is supposed to be resolved relative to the base URL of the stylesheet, which Prince now does correctly as you saw.