What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Only display certain CSS div elements in specific browsers

Only display certain CSS div elements in specific browsers
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
O.P. Only display certain CSS div elements in specific browsers
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.
12-31-2009 08:50 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Only display certain CSS div elements in specific browsers
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]-->
}


This post was edited on 12-31-2009 at 09:17 PM by matty.
12-31-2009 09:14 PM
Profile E-Mail PM Find Quote Report
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
O.P. RE: Only display certain CSS div elements in specific browsers
Thanks, but hmm, doesnt seem to be working, probably my fault somewhere though.
Fixed it, thanks a lot :)

This post was edited on 01-01-2010 at 01:14 AM by Jimbo.
01-01-2010 01:04 AM
Profile E-Mail PM Find Quote Report
user27089
Disabled Account


Posts: 6321
Joined: Nov 2003
Status: Away
RE: Only display certain CSS div elements in specific browsers
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.

This post was edited on 01-01-2010 at 12:35 PM by user27089.
01-01-2010 12:34 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On