Full width home advertisement

Welcome Home

Post Page Advertisement [Top]

The HTML <base> Tag

The HTML <base> tag is used for defining the base URL for all relative URLs in a page, so that all the other URLs will be concatenated into base URL while locating for the given item.

For example, we will use http://www.scholarsglobe.com as our base here.

<!DOCTYPE html>



<title>Scholars HTML Base Tag Example</title>

<base href="http:// www.scholarsglobe.com /" />



<img src="/images/logo.png" alt="Logo Image"/>

<a href="/html/index.htm" title="HTML Tutorial"/>HTML Tutorial Example</a>



The base href will add the base link http://www.scholarsglobe.com to both the image source and html link source in this order:  

Image: http://www.scholarsglobe.com//images/logo.png
HTML Link: http://www.scholarsglobe.com/html/index.htm

No comments:

Post a Comment

Bottom Ad [Post Page]