in reply to (OT) How to hide DIV contents from incompatible browsers?

Well, on the server side, you'd detect what browser is being used, and decide whether or not to display the div, yes?
If you dont want to use style sheets at all for this, and you know there are no comment tags within the DIV, you could comment around the DIV in your cgi, such as:
<!-- <DIV> whatever is in here </DIV> -->
Alternately, you could directly put into the DIV
<DIV STYLe='display: none;'>

Replies are listed 'Best First'.
Re^2: (OT) How to hide DIV contents from incompatible browsers?
by jhourcle (Prior) on May 06, 2005 at 02:06 UTC

    If the browser doesn't support CSS, then it's going to ignore the order not to display, and it's going to show up.

    If you're going to go to the trouble of doing server-side browser detection (which I _really_ _really_ don't recommend, it's better to degrade gracefully than to intentionally give them lower quality because of some string that they send you), then you could just not send the block, rather than embedding it in a comment.

    And as odd as this sounds -- if a browser correctly parses SGML comments, then <!-- <!-- blah --> --> will not show anything through to the user. (as when there's a '--' within a comment declaration, it's not supposed to end when it sees the close. It's only supposed to close if there's a even number of '--' pairs. (unfortunately, most people don't know this rule, and do things like use 'i--' in javascript), so browsers tend to incorrectly parse SGML comments intentionally.)