I'm not sure exactly what you are trying to do, but your answer can be found on this page of an html tutorial.
http://www.html.net/tutorials/css/lesson3.asp
Just go there and they show examples in css. Use the code they give you for the way you want it to be done. Hope this helps.