HyperText Markup Language/Textual Formatting

As with almost all programming languages and Markup Languages there are several different ways of formatting text. HTML is no exception.

A popular way to format HTML is to use specific HTML tags such as ,  and. The World Wide Web consortium (W3C) suggest these tags may not be supported in future and that you use, and to add formatting to text on the HTML page.

In practice, these methods are both fine to use, but are limited in the ways that text can be formatted.

Thus, many HTML authors are shifting towards using CSS (Cascading Style Sheets) which employs "style sheets" and "inline styles" to add formatting to text. It should be noted that using CSS one can redefine the appearance of text inside all tags of a particular type. See the section on classes below for details.

Inline styles
Through CSS (Cascading Style Sheets) you can reuse code using "classes" which contain "styles" (ways of formatting text). You can also put CSS styles inline, as in the following:

This is a paragraph of double-size bold text

results in

This is a paragraph of double-size bold text

Classes
Classes can be defined in two places; in style tags in HTML documents and in external files, the "style sheets" referred to in the name "Cascading Style Sheets". The term "cascading" refers to the mechanism by which the correct style is chosen when multiple style sheets are to be applied to the same document.

An example style tag:

 a { font-weight: bold; } a.special { color:red; }

An example of the contents of a style sheet file: a { font-weight: bold; } a.special { color:red; }

HTML/Organizzare il testo