HTML Meta Data and Scripting

The meta data and scripting tags, for the most part, are encompassed by the opening and closing 'head' tags. The 'script' and 'noscript' tags can also be used within the body section of an HTML page.

<base>

The 'base' tag can be used within the opening and closing 'head' tags to define a base path or URL for all items on a page, such as images, so when one is added to a page the whole path does not need to be included.

Without the use of a 'base' tag an image in a folder named 'images' on this website would need to be defined as follows.

<img src="https://www.stuartsplace.com/images/example.png">

When the 'base' tag is defined as follows:

<base href="https://www.stuartsplace.com/images/">

The image definition can be simplified:

<img src="example.png">

The 'base' tag can also be used to specify a default target for all links on a page, for example, to open up in a separate window.

<base target="_blank">

Only one base tag can be defined on a page, so if both a base path and target need to be defined, then the above examples would have to be combined.

<base href="https://www.stuartsplace.com/images/" target="_blank">

Further Reading

<style>

The 'style' tag is used to define styles for the look and feel of an HTML page at the page level, instead of having them in a style sheet for use on all pages of a website. These styles are defined within the 'head' section of a page. All styles that can be defined within a Cascading Style Sheet (CSS) are also available to use with the style tag, for example, setting the text colour of 'h1' headings to green.

<style>
   h1 
   {
      color: #00ff00;
   }
</style>

Further Reading

Other Meta Data and Scripting Tags