You'll never be able to do that with a style or html
Pinpoint the nav bar template, then create a callback tag, then create your callback class script. This would be one and most likely the easiest way.
The proper way *I believe* to do this is to extend the controller / view, add your additional stuff to viewParams and hook that in. This way, you could use your variables in the template.