Department of Engineering

IT Services

META lines in HTML files

In the HEAD part of an HTML file the META tag can be used for various purposes. It's used in 2 ways - the property you're setting can be chosen using name= or HTTP-EQUIV=. In either case you set the property's value by using content= as the next 2 examples show

<meta name="keywords" content="concrete,bridges,engineering"> <meta HTTP-EQUIV="expires" CONTENT="Wed, 1 Jan 2003 12:00:00 GMT">

HTTP-EQUIV

This affects the header of the document when it's sent, thus helping the browser to display the document

  • <META HTTP-EQUIV="Refresh" CONTENT="3; URL=http://www.eng.cam.ac.uk/"> - after 3 seconds the new page will be loaded in (if the browser's capable of doing so).
  • <META HTTP-EQUIV="content-type" CONTENT=text/html; charset="EUC-2"> - tells the browser the character set used in the page so that 'funny characters' can be displayed correctly
  • <META HTTP-EQUIV="expires" CONTENT="Wed, 1 Jan 2003 12:00:00 GMT"> - the file won't be cached

name

This tends to be used to provide extra information for archiving purposes. There are many options - you can invent your own too. The following examples show some commonly used features

  • <META name=author content="Tim Love">
  • <META name=description content="An introduction to Bridges"> - This description is sometimes used by search engines when your page is listed
  • <META name=keywords content="concrete,bridges,engineering"> - to help search engines
  • <META name=robots content="noindex,nofollow"> - This suggests to robots (the programs that provide the search engines with information) that the page shouldn't be read.