Shoutbox

Only display certain CSS div elements in specific browsers - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Only display certain CSS div elements in specific browsers (/showthread.php?tid=93391)

Only display certain CSS div elements in specific browsers by Jimbo on 12-31-2009 at 08:50 PM

What I am trying to do is detect the browser a user is using, and then if its anything but IE, display a specicifc div element, in this case "footer", but if the user is using IE, do not display this element. Or, which is probably easier, detect the browser, and if IE, display nothing, else, display "blah".

Ok that sounded very weird after re-reading, so I'll just show you what I mean. http://sammyservers.com - The bottom footer containing the links works fine in all browsers (that I have checked) except IE, which positions it further across the page. So I am trying to just hide that element, if the user is using IE.


RE: Only display certain CSS div elements in specific browsers by matty on 12-31-2009 at 09:14 PM

css code:
#footer{
    position: fixed;
    _position: absolute;
    bottom: 0;
    _top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);
    _text-align:left;
    text-align:center;
    border: 1px solid #b2ceff;
    background-color: #d1dfff;
    width: 100%;
    <!--[if IE]>
         display: none;
    <![endif]-->
}

RE: Only display certain CSS div elements in specific browsers by Jimbo on 01-01-2010 at 01:04 AM

Thanks, but hmm, doesnt seem to be working, probably my fault somewhere though.
Fixed it, thanks a lot :)


RE: Only display certain CSS div elements in specific browsers by user27089 on 01-01-2010 at 12:34 PM

Remember that for usability reasons you should always try and avoid hiding stuff in certain browsers unless necessary. Visual elements are fine to hide, but if you start hiding structural elements like footers etc, the site will look strange.

Instead of hiding it, find a workaround.

I'll help you out with anything, shoot me a PM.