YouTip LogoYouTip

Att Base Target

## HTML <base> target Attribute The `target` attribute of the `` tag specifies the default destination/target window or frame where all hyperlinks and forms on a page will open. By setting this attribute once in the document head, you establish a global default behavior for the entire page, eliminating the need to add `target="_blank"` or other target values to every individual link. --- ## Quick Example The following example sets the default target for all links on the page to open in a new window or tab: ```html

Visit YouTip (Opens in a new tab)

Visit Wikipedia (Also opens in a new tab)

``` --- ## Browser Support The `target` attribute of the `` tag is fully supported by all modern web browsers: | Attribute | Chrome | Edge / IE | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | **target** | Yes | Yes | Yes | Yes | Yes | --- ## Definition and Usage * **Global Default:** The `target` attribute defines the default browsing context (such as a tab, window, or iframe) for all relative and absolute hyperlinks (``), area maps (``), and form submissions (`
`) on the page. * **Local Override:** This global default can be overridden on individual elements by explicitly defining a `target` attribute directly on a specific ``, ``, or `` tag. --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | `_blank` | Opens the linked document in a new window or tab. | | `_self` | Default. Opens the linked document in the same frame/tab as it was clicked. | | `_parent` | Opens the linked document in the parent frame. | | `_top` | Opens the linked document in the full body of the window (breaking out of any frames). | | `*framename*` | Opens the linked document in a custom named ` ``` --- ## Important Considerations 1. **Placement:** The `` tag must be placed inside the `` element, and it should appear before any other elements that use URLs (such as `` stylesheets or `` tags). 2. **Single Instance:** There can be at most one `` element in a document. 3. **Security & Performance:** When using `target="_blank"`, modern browsers automatically apply `rel="noopener"` to prevent security vulnerabilities (like tab-nabbing) and optimize performance. However, for older browser compatibility, manually adding `rel="noopener noreferrer"` to overriding links is still considered a best practice.
← Att Basefont ColorAtt Base Href β†’