You have the right idea.
JSF doesn't support styling, because CSS already does.
I use styles all the time, but in order to make it easier to "skin" a website, I prefer to use stylesheets instead of putting explicit style info on individual items. However, in JSF, instead of "class=", use the "styleClass=" attribute. They had to make that one small change since "class" is a reserved work in
Java.
As to why your page isn't working, try viewing the generated HTML using your web browser's "view page source" function and see if the HTML style specs are OK.