Why does the base tag seem to be working in Opera and Chrome, but not in Firefox and IE?
I have a site where I use the base tag. All the links in the site are relative, and I set an absolute href so that all the links should be aimed at the ri开发者_开发知识库ght target. And it works in Opera and Chrome. All links in the menu works, all images and style-sheets are found. But in Firefox and IE they are not. And I don't get it!
I can browse it without problems in Opera and Chrome. While in FireFox and IE, it is all messed up when I get to one of the pages that are in a sub-directory. Have I misunderstood something about how that tag is supposed to be used? Or?
This is the site: http://sites.geekality.net/vipersystem/
From the HTML 4.01 specification: Base Element
href = uri [CT] This attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.
However the HTML 5 draft drops the requirement that the Base element be an absolute URI, so I guess Opera and Chrome have already implemented that relaxation.
The base
tag only supports absolute paths in Firefox, it seems.
http://forums.mozillazine.org/viewtopic.php?f=38&t=366823&start=0&st=0&sk=t&sd=a
http://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE
Ergo,
<base href = "http://sites.geekjuggler.net/vipersystem/" />
should work.
精彩评论