Difference between _self, _top, and _parent in the anchor tag target attribute

前端 未结 5 1566
北荒
北荒 2020-12-13 05:20

I know _blank opens a new tab when used with the anchor tag and also, there are self-defined targets I use when using framesets but I will like to know the diff

5条回答
  •  眼角桃花
    2020-12-13 06:19

    Section 6.16 Frame target names in the HTML 4.01 spec defines the meanings, but it is partly outdated. It refers to “windows”, whereas HTML5 drafts more realistically speak about “browsing contexts”, since modern browsers often use tabs instead of windows in this context.

    Briefly, _self is the default (current browsing context, i.e. current window or tab), so it is useful only to override a setting. The value _parent refers to the frameset that is the parent of the current frame, whereas _top “breaks out of all frames” and opens the linked document in the entire browser window.

提交回复
热议问题