There are (at least) two ways to do this:
1) Define your heading as follows:
<h2 id="h2Centered">Test</h2>
then in your style sheet define the styles for this element as
#h2Centered {
...................
}
the # signifies that the style is for an element Id.
2) Define your heading as follows:
<h2 class="h2Centered">Test</h2>
then in your style sheet define the styles for this class as
.h2Centered {
...................
}
HTH,
JC