Add Site or Add Page to Favorites
 

 Miles Per Gallon Usage 


HTML tutorial articles and HTML reference for beginners guide to HTML


Get information on your favorite TV Shows at TV Series .com


Printer-friendly PDF* format:

Miles Per Gallon

HTML for MPG Acronym

when MPG means Miles Per Gallon

New! Now updated with the inheritance rules for the title attribute in HTML 5

The easiest way to create HTML code indicating that the acronym MPG stands for Miles Per Gallon is to simply include the acronym in an HTML <a> tag and an abbreviation tag (not an acronym tag):

<a href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon"
onclick="if (confirm('MPG stands for Miles Per Gallon')) return false;"
>
<abbr>MPG</abbr>
</a>

This is the recommended code for both HTML 4 browsers and HTML 5 browsers. Some browsers, most notably IE, do not activate help when the title attribute is coded on the <abbr> tag, but they do work as expected for titles on the <a> tag. The <abbr> tag inherits its title attribute from the parent <a> tag.

If you are creating HTML code for the definition of Miles Per Gallon, the meaning of the acronym MPG, then include a <dfn> definition tag around the <abbr> abbreviation tag and follow the entire HTML code for the hypertext link with the definition of the term:

<p>A <a href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon"
onclick="if (confirm('MPG stands for Miles Per Gallon')) return false;"
>
<dfn><abbr title="Miles Per Gallon">MPG</abbr>
</a> is ...(definition of Miles Per Gallon)....</p>

The <dfn> tag gets the term being defined from the title attribute of the <abbr> tag. The result should look like this (hovering your mouse over the MPG acronym shows the expanded meaning of the acronym):

A MPG is ...(definition of "Miles Per Gallon")....

If you are creating HTML code that simply expands the acronym then indicate that it is the MPG acronymn which is being defined using an HTML <dfn> tag with a title attribute around the <abbr> tag and follow the HTML for the hypertext link with the acronym definition:

<p>When we use the acronym <a href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon"
onclick="if (confirm('MPG stands for Miles Per Gallon')) return false;"
>
<dfn title="MPG"><abbr title="Miles Per Gallon">MPG</abbr></dfn>
</a> it is the abbreviation for Miles Per Gallon.</p>

The result should look like this (hovering your mouse over the MPG acronym shows the definition):

When we use the acronym MPG it is the abbreviation for Miles Per Gallon.

Acronym Vocabulary URI Declaration

For the remaining examples, the Acronym Vocabulary namespace URI needs to be declared for use with element tag names and attribute values. For an HTML web page, the beginning of the file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
<!ENTITY at "http://Acronyms.net/terms/">
<!ENTITY av "http://Acronyms.net/vocabulary/">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:av="&av;">
<head>
<style type="text/css">
.hide { display: none }
</style>
...

This only needs to be done once per document file.

XLink simple link

First, declare the vocabulary as shown above. Then, add acronyms as follows:

<a href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon"
xlink:type="simple"
xlink:href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/"
xlink:arcrole="&av;definedAt"
xlink:role="&av;definition"
xlink:title="Miles Per Gallon"
xlink:show="new"
xlink:actuate="onRequest"
>
<abbr
xlink:type="simple"
xlink:href="&at;Miles-Per-Gallon"
xlink:arcrole="&av;standsFor"
xlink:role="&av;term"
xlink:title="MPG - Miles Per Gallon"
xlink:show="new"
xlink:actuate="onRequest"
>MPG</abbr></dfn>
</a>

XLink extended link

First, declare the vocabulary as shown above. Then, add acronyms as follows:

<a xlink:type="extended" href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon">
<abbr xlink:type="resource" xlink:label="acronym">MPG</abbr>
<span class="hide" xlink:type="resource" xlink:label="verbal" xlink:title="pronunciation">m p g</span>
<span class="hide" xlink:type="resource" xlink:label="expand" xlink:title="expansion">Miles Per Gallon</span>
<span class="hide" xlink:type="locator" xlink:label="term" xlink:role="&av;term" xlink:href="&at;Miles-Per-Gallon" xlink:title="Miles Per Gallon"/>
<span class="hide" xlink:type="locator" xlink:label="definition" xlink:role="&av;definition" xlink:href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" xlink:title="Miles Per Gallon"/>
<span class="hide" xlink:type="locator" xlink:label="finder" xlink:role="&av;reference" xlink:href="http://www.Acronyms.net/reference/m/MPG#Miles-Per-Gallon" xlink:title="MPG - Miles Per Gallon"/>
<span class="hide" xlink:type="arc" xlink:from="acronym" xlink:arcrole="&av;pronounceAs" xlink:to="verbal" xlink:actuate="onLoad"/>
<span class="hide" xlink:type="arc" xlink:from="acronym" xlink:arcrole="&av;expandsTo" xlink:to="expand"/>
<span class="hide" xlink:type="arc" xlink:from="acronym" xlink:arcrole="&av;standsFor" xlink:to="term"/>
<span class="hide" xlink:type="arc" xlink:from="term" xlink:arcrole="&av;definedAt" xlink:to="definition" xlink:show="new" xlink:actuate="onRequest"/>
<span class="hide" xlink:type="arc" xlink:from="acronym" xlink:arcrole="&av;foundAt" xlink:to="finder" xlink:show="new" xlink:actuate="onRequest"/>
</a>

embedded RDF metadata

First, declare the vocabulary as shown above. Then, add acronyms as follows:

<a href="http://www.Acronyms.net/terms/m/Miles-Per-Gallon/" title="Miles Per Gallon">
<abbr>MPG</abbr>
</a>

You are currently viewing this page in HTML 5 XML* format (* see Clicklets for more infomation). This document is also available in HTML 5 Style Sheet*XML* HTML 5 non-XML*XHTML Style Sheet* XHTML* HTML 4* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.


Copyright © 2012 Acronyms .net. All rights reserved. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.

DISCLAIMER: All information, links, forms, applications and any other items on this site are provided AS IS, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.