Why should I replace my div = id with a div = class ??
IDs cant be repeated.. is just bad mojo. Not just for CSS but for any Javascript you may have running. So if you need to have the same ID then its a class. otherwise make the IDs unique to the page each time they are output...

You can use PHP to add styling by echoing class="whatever" to whatever you need to style. It can even be in addition to the IDs you have AND you could .. if you so wished to streamline your code ... make the the added class name a variable... echo"class='$whatever' "; that way it could even be in a separate function....

but what I was trying to say in my earlier post .. is that the styling is not done by PHP... it is done by CSS.. so the key here is to use PHP to target where you want a css style applied ... ( whether the nav is constructed in one or 3 places doesnt matter then) you can ADD the rules you need by adding a class to the element along the ID... <div id="navbar2" class="whatever"> and add .whatever{your:rules...} to your CSS style sheet.

Either way, you still should only use the IDs once in the name space.