IE doesn't support relative paths in the base element when referencing CSS files

后端 未结 2 424
不思量自难忘°
不思量自难忘° 2021-01-03 04:03

I have a site that uses a base tag to set an absolute path for relative URLs. It works fine in all the browsers I tested it in, except IE (big surprise). Based on the reques

2条回答
  •  庸人自扰
    2021-01-03 04:28

    I don't know for sure if this is your issue in IE or not, but according to relevant portion of the HTML 4.01 standards document, the URL in the base href must be an absolute URI. Further, in the example, given it looks like this (with a filename on it):

    
    
     
       Our Products
       
     
    
     
       

    Have you seen our Bird Cages?

    In Google searches, I found discussion of what version Firefox added support for relative paths in the base href (which is what you are using) so that is clearly not something that has always been there and not something the 4.01 standard appears to describe.

    The HTML5 spec seems to describe and allow base URLs to not have a host portion (host relative) so perhaps that is something that has been added to the specs recently which IE has not supported yet or has not fully supported yet for CSS file loading.

    I would suggest you try putting your domain in the base HREF.

提交回复
热议问题