HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <base> tag

The HTML <base> element specifies the base URL to use for all relative URLs contained within a document.

There can be only one <base> element in a document, and it must be inside the <head> element.

Run code

If the <base> tag is present, it must have either an href attribute or a target attribute, or both.

Browser compatibility

The <base> element is fully supported by all browsers:

<base> yes yes yes yes yes


The following table shows the attributes that are specific to the <base> tag:

Attribute Value Description
href URL Specifies the base URL for all relative URLs in the document
Specifies the default target for all hyperlinks and forms in the page

Global Attributes

The <base> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <base> tag does not support any event attributes. See HTML Events Reference

More Examples

The following example specifies a default target for all hyperlinks and forms on a page:

Run code
Tags: Reference

Last updated: Monday 17 Sep, 2018