Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Base Element Demo</title> <!-- All relative URLs on this page now resolve relative to https://example.com/docs/v2/ --> <base href="https://example.com/docs/v2/"> </head> <body> <h1>Documentation</h1> <!-- Resolves to: https://example.com/docs/v2/intro.html --> <a href="intro.html">Introduction</a> <!-- Resolves to: https://example.com/docs/v2/img/logo.png --> <img src="img/logo.png" alt="Logo"> <!-- Absolute URLs are NOT affected by <base> --> <a href="https://other-site.com">Other Site</a> <!-- Override target for a single link --> <a href="notes.html" target="_self">Notes (same tab)</a> </body> </html>
Result
Open