What are the recommendations for html <base> tag?

前端 未结 17 2272
一向
一向 2020-11-21 10:17

I\'ve never seen HTML tag actually used anywhere before. Are there pitfalls to its use that means I should avoid it?

The fact that I have never noticed

17条回答
  •  眼角桃花
    2020-11-21 10:51

    Base href example

    Say a typical page with links:

    home faq etc
    

    .and links to a diff folder:

    ..Portal2home p2faq p2etc..
    

    With base href, we can avoid repeating the base folder:

    
    Portal2-Home P2FAQ P2Contact
    

    So that's a win.. yet pages too-often contain urls to diff bases And the current web supports only one base href per page, so the win is quickly lost as bases that aint base∙hrefed repeats, eg:

    home faq etc
    
    
    
    Portal2-Home P2FAQ P2Contact
    


    Conclusion

    (Base target might be useful.) Base href is useless as:

    • page is equally WET since:
      • default base [–parent folder] ⇌ perfect (unless unnecessary/rare exceptions 𝒞1 & 𝒞2).
      • current web ⇌ multiple base hrefs unsupported.

    Related

    • comparison with Apache∙rewrite base

提交回复
热议问题