Code has been added to clipboard!

HTML base Tag

Reading time 2 min
Published Mar 19, 2019
Updated Oct 1, 2019

HTML base Tag: Main Tips

  • <base> element defines base URL for all the relative links in the HTML document.
  • HTML <base> tag does not have the closing tag.

Use of base

<base> specifies the HTML base URL for relative links in a web page.

Example
<head>
  <title>HTML base tag example</title>
  <base href="https://www.bitdegree.org/courses">
</head>

There are certain rules for using this element:

  • <base> HTML must be included only once in the HTML file.
  • It has to be put in the <head>.
  • Do not add content inside the HTML <base> tag.
  • Do not include a closing tag.
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

Attributes for base

href

The <base href=""> defines the base URL for all the relative URLs in the document.

Example
<head>
  <base href="https://www.bitdegree.org/course/">
</head>

target

By including the target attribute, you can set the <base> HTML to open links either in the current browser window or in a new one.

Example
<head>
<base target="_blank">
</head>
  • _self opens the link in the same browser window.
  • _blank opens the link in a new browser window.
  • _parent opens a link in a parent window of the current window.
  • _top opens a link in the top-level browsing window.

Browser Support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
1+
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile Browser Support

Browser image
Chrome
All
Browser image
Firefox
4+
Browser image
Opera
All
Browser image
Safari
All

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 03/03/2021
3176 People Used
Only 97 Left
Rating
5.0