The new HTML5 DOWNLOAD attribute for A HREF

Example:

  1. <ahref=“//d37djvu3ytnwxt.cloudfront.net/assets/courseware/v1/aa323a9c005768df2c1e674c31002efb/asset-v1:W3Cx+HTML5.1x+3T2016+type@asset+block/normal.gif”
  2.    download=“MichelBuffa.gif”>
  3.     download a picture of Michel Buffa
  4. </a>

WARNING: since 2015, and for security reasons, the image should be located on the same domain as the HTML page that contains the link (using a relative URL works well, for example, but linking a page on another domain will not work – it will keep its original name).

The HTML5 TRANSLATE ATTRIBUTE

HTML5 gives us a new translate attribute. This attribute is used to limit the impact of  translation tools such as Google Translate by prohibiting the translation of certain content. In many cases some parts of a document should not be translated.

Use cases include:

    • HTML pages that contain source code: you would certainly not like to see the Java or PHP or whatever programming language parts of your page translated into another spoken language!
    • Video game Web sites that propose cheat codes; the codes do not have to be translated,
    • Street names, author names in an “about” page must not be translated,
    • etc.

<p translate=“no”>This is a text in a paragraph element, that should not be translated: the p element has a translate=”no” attribute.<span> This part that is in a span element embedded within the paragraph. It does not have a translate attribute but inherits the translation-mode of the p and will not be translated too</span>. This is the end of the paragraph…</ p>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s