I am currently hiding a div based on an if statement. The method I use is, use echo out a css style of display: none
Here is w
I generally try to avoid using PHP Conditionals inside of CSS; especially inline CSS (CSS that is on the same page).
I would keep your CSS in its own CSS file and use the PHP conditional to either add a "hide" class to the DIV -OR- not echo the DIV at all.
class="hide">
Foo bar
or alternatively
Foo bar
or
Foo bar
Many times the div needs to be outputted so it can be re-displayed using JavaScript (e.g. carousels, sliders, etc.)