Lesser-known semantics examples

This file contains all of the code examples from the "Lesser known semantic elements" article, so you can see a live example of how all the source code renders in a browser.

Simple address example

Mark Norman Francis, 1-800-555-4865

Advanced address example

Incorrect address example

Our company address:

Opera Software ASA, Waldemar Thranes gate 98, NO-0175 OSLO, NORWAY

First code example

It is bad form to use event handlers like onclick directly in the HTML.

Second code example

It is bad form to use event handlers like onclick directly in the HTML.

Computer interaction example

One common method of determining if a computer is connected to the internet is to use the computer program ping to see if a computer likely to be running is reachable.

              kittaghy% ping -o google.com
              PING google.com (64.233.187.99): 56 data bytes
              64 bytes from 64.233.187.99: icmp_seq=0 ttl=242 time=108.995 ms

              --- google.com ping statistics ---
              1 packets transmitted, 1 packets received, 0% packet loss
              round-trip min/avg/max/stddev = 108.995/108.995/108.995/0.000 ms
            

Variables example

The value of x in 3x+2=14 is 4.


                my $welcome = "Hello world!";
            

Citations example

The saying Everything should be made as simple as possible, but not simpler is often attributed to Albert Einstein, but it is actually a paraphrasing of a quote which is much less easy to understand.

Abbreviations example

Styling is added to HTML documents using CSS.

First defining instances example

HTML ("HyperText Markup Language") is a language to describe the contents of web documents.

Second defining instances example

HTML ("HyperText Markup Language") is a language to describe the contents of web documents.

Third defining instances example

HTML (HyperText Markup Language) is a language to describe the contents of web documents.

Superscript and subscript example

The chemical formula for water is H2O, and it is also known as hydrogen hydroxide.

The famous formula for mass-energy equivalence as derived by Albert Einstein is E=mc2 — energy is equal to the mass multiplied by the speed of light squared.

Line breaks example

Our company address:

Opera Software ASA,
Waldemar Thranes gate 98,
NO-0175 OSLO,
NORWAY

Inserting, deleting and outdated example

We should only solve problems that actually arise. As Donald KnuthC. A. R. Hoare said: premature optimization is the root of all evil.

The president of the USA is currently George W. Bush.