MyTetra Share
Делитесь знаниями!
<base> - базирование ссылок страниц
Время создания: 01.10.2017 11:05
Раздел: HTML
Запись: xintrea/mytetra_db_mcold/master/base/1506845115sly1ulmd5z/text.html на raw.githubusercontent.com

The HTML <base> Tag

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

For example, all the given pages and images will be searched after prefixing the given URLs with base URL http://www.tutorialspoint.com/ directory −

<!DOCTYPE html>
<html>

   <head>
      <title>HTML Base Tag Example</title>
      <base href = "http://www.tutorialspoint.com/" />
   </head>

   <body>
      <img src = "/images/logo.png" alt = "Logo Image"/>
      <a href = "/html/index.htm" title = "HTML Tutorial"/>HTML Tutorial</a> 
   </body>

</html>

This will produce the following result −

But if you change base URL to something else, for example, if base URL is http://www.tutorialspoint.com/home then image and other given links will become like http://www.tutorialspoint.com/home/images/logo.png and http://www.tutorialspoint.com/home/html/index.htm

 
MyTetra Share v.0.65
Яндекс индекс цитирования