The <base> element specifies the base URL and base target for all relative URLs in a page. This can help browsers to more quickly find elements needed to display the webpage:
HTML file: | Displayed by browser: |
---|---|
<base href="http://www.w3schools.com/images/" target="_blank">
<body> <img src="html5.gif"> <p>Since we have specified a base URL, the browser will look for the image <b>html5.gif</b> at <b>http://www.w3schools.com/images/</b>.</p> <p><a href="http://www.w3schools.com">W3Schools</a></p> <p>The link above opens in a new window because the base target is set to <b>"_blank"</b>.</p> </body> |
Since we have specified a base URL, the browser will look for the image html5.gif at http://www.w3schools.com/images/. The link above opens in a new window because the base target is set to "_blank". |
Hmmmm... well, this was a tricky thing! My green buttons are not located at the base URL, so they didn't display at first. Obviously I cannot use the