w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it

base, a override browsing context

Learn to override, on Element level, the default browsing context.

If you set a default browsing-context for all hyperlinks in page, through base element, like this:

<base target="_blank">, all hyperlinks open in a new browsing-context (new browsing window)

but you want 1 hyperlink from that page to open in a different browsing-context, e.g. the current browsing-context = the current window.
In this case you need to add the current browsing context on element level like this:

<a href="url" target="_self">link<⁄a>

Video demonstration base, how to override the default browsing context

HTML5 base, override default browsing context, Tutorial

min video details
00:17 adding the base tag in page, inside head section
00:20 setting a default browsing-context:
00:30 refreshing the page
00:32 test: clicking on hyperlinks
00:34 test result ok: all hyperlinks open in a new browsing context (a new window)
00:45 let's set a different browsing-context for hyperlink Page3
00:55 on Element level (the a element) we are adding the target="_self"
01:11 all hyperlinks opens in a new browsing context (a new window) except Page3 which will open in the current browsing window
01:14 refreshing the page
01:15 testing all hyperlinks
01:24 all but one open in a new browser window; the one, Page3, opens in the current window
01:26 this is how you can override the default targeted browsing context on Element level
base intro base optional base occurrences base browser display base parents all browsing contexts base resolves only URLs.. base syntaxbase href attributebase target attribute