You do it in just the same way. For example, you put your code in a line like
<div class="code"> ...[code goes here]...</div>
and then in the CSS, you put
There may be other, better ways of achieving the same effect, but it's difficult to say what would be best from what you've told us so far.