-1

I have this HTML document that started with

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

and contained a

<link href="https://somewhe.re/path/to/file.css" type="text/css" rel="stylesheet" media="screen" />

The content of the linked CSS file didn't seem to have any effect on the rendering of the HTML document, however. But when I downloaded the CSS file and referenced it locally (that is with a href="../css/file.css"), it worked as expected.

That was frustrating at best and I tried everything I could imagine to solve the "problem", but I couldn't reference the file on the server via HTTPS. Yet, when I changed the <!DOCTYPE...> to a simple <!DOCTYPE> it worked. I didn't expect that. Although it works now, I'd still like to know what's going on here.

Edit: The CSS' URL is https://raw.github.com/golovko/Fixed-Header-Table/master/css/defaultTheme.css.

mgthomas99
  • 5,402
  • 3
  • 19
  • 21
René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293

2 Answers2

1

At first glance I would suspect the problem has to do with the self-closing <link>. That's valid XHTML, but not so much HTML4. This SO post has some good detail: Are self-closing input tags valid in HTML 4?

Try removing the slash at the end of the link tag and see what happens.

Community
  • 1
  • 1
chprpipr
  • 2,039
  • 16
  • 17
0

Why not try putting ../path/file.css instead of the full path. Maybe there is a spelling error? Self closing link tags are accepted in HTML 4 by the way.

Michael Garrison
  • 941
  • 2
  • 15
  • 31