Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Image using figure

A basic <figure> and <figcaption> example using images

Fig1. MDN Logo
MDN Logo

Code using figure

An example to demonstrate the use of figure and figcaption with code

Get browser details using navigator
          function NavigatorExample(){
          var txt;
          txt = "Browser CodeName: " + navigator.appCodeName;
          txt+= "Browser Name: " + navigator.appName;
          txt+= "Browser Version: " + navigator.appVersion ;
          txt+= "Cookies Enabled: " + navigator.cookieEnabled;
          txt+= "Platform: " + navigator.platform;
          txt+= "User-agent header: " + navigator.userAgent;
          }            
        

Other uses of <figure> and <figcaption>

Quotes, parts of poems can also be a part of figure

Edsger Dijkstra :-

"If debugging is the process of removing software bugs,
then programming must be the process of putting them in"


The above examples have <figcaption> as the first element of <figure> so now we will try it being the last element as w3c recommends it can be either first or last element of <figure>


Image using figure

A basic <figure> and <figcaption> example using images

MDN Logo
Fig1. MDN Logo

Code using figure

An example to demonstrate the use of figure and figcaption with code

          function NavigatorExample(){
          var txt;
          txt = "Browser CodeName: " + navigator.appCodeName;
          txt+= "Browser Name: " + navigator.appName;
          txt+= "Browser Version: " + navigator.appVersion ;
          txt+= "Cookies Enabled: " + navigator.cookieEnabled;
          txt+= "Platform: " + navigator.platform;
          txt+= "User-agent header: " + navigator.userAgent;
          }            
        
Get browser details using navigator

Other uses of <figure> and <figcaption>

Quotes, parts of poems can also be a part of figure

"If debugging is the process of removing software bugs,
then programming must be the process of putting them in"

Edsger Dijkstra