When should I use HTML frames?

前端 未结 4 1476
Happy的楠姐
Happy的楠姐 2021-02-04 02:09

I have heard countless reasons on why not to use HTML frames, from their lack of accessibility, the general lacking in UX, their being completely inefficient/unmaintainable, or

4条回答
  •  萌比男神i
    2021-02-04 03:00

    (1) No. There are legitimate uses for iframes, where there's no reason to use frames today with modern browsers.

    (2) Never use frames; there's other better easier solutions available to produce the same effect.

    Use iframes only when embedding the whole site is the most logical option. Although rare, there are occasions when this makes sense.

    In short, there's a reason why the frame/frameset/noframe tags are taken out of HTML5, but the iframe will carry over.

    (example) If site A is obliged to include a page from site B (proxied to appear to come from site A) then site B css and javascript can and usually will completely hose site A. This is a legitimate reason.

提交回复
热议问题