Extensive CSS Support detection

Hi experts !
I need a CSS detection in Javascript that could detect the following CSS support :
- fontsize
- fontcolor
- fontfamily
I'd need to display a different message depending on which checkbox is unchecked (which css styles are disabled) in the client's browser (for both IE and NN)???
rouxjeanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arantiusCommented:
rouxjean,
I do not believe it is possible to test for that directly.  The best you could do is detect the browser in another way, and assume based on that the CSS support available.
http://www.google.com/search?q=browser+sniffer
0
archrajanCommented:
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

archrajanCommented:
0
rouxjeanAuthor Commented:
To give a hint :
here is font family + font size
=========================================================================
<span id=arial style="font-family:Arial Narrow;visibility:hidden">wwwwwwwwwwwwwww</span><br>
<span id=verdana style=font-size:Verdana;visibility:hidden>wwwwwwwwwwwwwww</span><br>
<span id=csscheck style=font-size:15px;visibility:hidden>rouxjean</span><br>
<script>
function checkCSS()
{
     document.getElementById("csscheck").style.fontSize=22;
     if(document.getElementById("arial").offsetWidth==document.getElementById("verdana").offsetWidth)
     {
          alert("please enable font style")
          return;
     }
     if(document.getElementById("csscheck").offsetHeight<22)
     {
          alert("please enable font size")
          return;
     }
     alert("welcome")
}
</script>
<button onclick=checkCSS()>checkCSS</button>
=========================================================================
My question is how to make this work under NN and how to detect font Color support !!!
0
rouxjeanAuthor Commented:
I don't need a browser vs compatibility chart nor any tutorial on CSS :-S
I want to detect CSS element support for IE & NN !
0
justinbilligCommented:
if( document.stylesheets )
0
devicCommented:
I think to check color is not possible
0
rouxjeanAuthor Commented:
devic: that code is from you actually :-)
You never tried to make it work with Netscape, I thought maybe I would catch you in a better mood today :-D
Are you ? please !
0
devicCommented:
I don't have netscape right now, only firefox and it works ok.
I mean for offsetHeight
0
rouxjeanAuthor Commented:
So offsetWidth doesn't work right ? Do you think it is possible ?
0
devicCommented:
no rouxjean, just tested: it works right and in netscape and in firefox.
0
rouxjeanAuthor Commented:
devic:must have been testing with NN6 back at the time. It works with NN7. I guess there is no way to prevent the user to use his own style sheets, therefore overriding mine (IE option) ?
0
devicCommented:
rouxjean,
I don't have NN 6, only NN7.1, mozilla and firefox. If I remeber good, offsetWidth and any offset.... is IE4 object model and not W3C...
But NN6 I think support too. Anyway, if we speak about NON IE, then is firefox or mozilla, but not buggy NN6. I think so :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rouxjeanAuthor Commented:
My fault, should have tested it before :-S
I was thinking that maybe NN7 would have allowed more detection since it wasn't out then...
I'm sorry.
0
devicCommented:
np, thank you ;)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.