HTML syntax summary

Block vs. inline

Example 1

A block element, like the following <div>

is always displayed as if it had a linebreak before and after it,

separated from surrounding text. A block element cannot be embedded within the start and end tags of an inline element - but inline elements can be embedded within the start and end tags of a block element.

An inline element like this <span> is displayed in the flow of the surrounding content.

Example 2

Content within a pre block element, like

if( p->x() > 0 )

appears exactly as written, but separated from surrounding content.

Content within a code inline element, like if( p->x() > 0 ) appears exactly as written and inline.


Other inline elements

The em element indicates emphasized text.

This strong element indicates strongly emphasized text.

The abbr element indicates an abbreviation like FBI.

Use the cite element to cite a source like Wikipedia.

Use a dfn to indicate a definition: cruft - badly written code.

The samp is used to indicate sample output, like Abnormal Program Termination.

Use kbd to indicate a keyboard input, like rm -r *.

Use var to indicate a variable name like slkfjasdkjfa.

Use sup and sub for super- and sub-scripting, as in the Einstein Field Equation: Rab - 1/2 R gab = 8πG/c4 Tab

del and ins indicate deletedinserted text.

The br element
is used to explicitly
indicate a line break.

Here is an image:MSOE logo

Here is a link to the MSOE website.

Here is a image link to MSOE logo MSOE's website.