Es posible que el CSS no los estés poniendolo dentro del <head>
Debería ser algo así:
Código:
<html>
<head>
<style type="text/css">
h1 {font-size:14px; background-color: yellow; }
h2 {font-size:12px; background-color: pink; }
</style>
</head>
<body>
<h1>Título 1</h1>
<h2>Título 1</h2>
</body>
</html>