Nicholas,
I see the same behaviour. If the css is referenced with an absolute
path, WebBrowser sees it and uses it. If the css is referenced
without a path, WebBrowser doesn't find it. The syntax of the css is
perfect, AFAIK. It's been tested inside WebBrowser and in an external
browser, and it works in both cases (as long as a path is given to
it). So, the css syntax isn't causing the problem.
The problem must be, as you stated, "The web browser has no concept of
a current directory when it is run". So, where does it look when you
ask for a file without a path? There's really no current directory?
There's gotta be something. That's just weird. Is there any way to
inquire what the directory might be?
You said: "All relative URLs are resolved in relation to the address
of the document that was loaded." I've noticed that when I navigate
away from a webpage I made in memory, I cannot return to it (although
I can return to any 'real' webpages I click to, as long as I allow
navigation), so this original webpage of mine doesn't 'really exist'.
So, if it doesn't, then relative paths have nothing to go by. But
again, what does it do? Just assume the file doesn't exist? Seems
strange to me. But, I guess we can't change that.
Can you show the HTML and the CSS page?
CSS:
body
{
color: black;
font-family: georgia;
}
HTML:
<link rel="stylesheet" type="text/css" href="log.css" />
html code here
The only solutions I see:
1. include absolute path to CSS (but then the HTML file written to
disk will not work if the CSS is ever moved).
2. include the CSS inside the HTML itself (but then you cannot change
one CSS file and have all HTML files reformatted).
(I am creating an HTML + CSS, for a logger, and showing it in a
WebBrowser in real-time, but also saving them to disk for later
access)
Zytan