Centering lines of text
The most common and (therefore) easiest type of centering is that of lines of text in a paragraph or in a heading. CSS has the property 'text-align' for that:
P { text-align: center }
H2 { text-align: center }
renders each line in a P or in a H2 centered between its margins, like this:
The lines in this paragraph are all centered between the paragraph's margins, thanks to the value 'center' of the CSS property 'text-align'.