473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Testing for CSS2 support

Is it possible to test for CSS level 2 support, preferably using just
CSS2? For example, the following could alert the user that their
browser doesn't support CSS1 or 2. Is there an equivalent for level 2
only?

Many thanks,

Mike
<STYLE type="text/css">
DIV#no-css {
display: none;
}
</STYLE>

....

<DIV id="no-css">
<P>Your browser doesn't support cascading style sheets.</P>
</DIV>

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #1
12 1899
Michael Winter <M.******@blueyonder.co.uk.invalid> wrote in
news:Xn*******************************@193.38.113. 46:
Is it possible to test for CSS level 2 support, preferably using just
CSS2? For example, the following could alert the user that their
browser doesn't support CSS1 or 2. Is there an equivalent for level 2
only?


The problem is that no browser I'm aware of implements *all* of CSS2, at
least correctly.
Jul 20 '05 #2
Eric Bohlman wrote on 28 Nov 2003:

<snip>
The problem is that no browser I'm aware of implements *all* of
CSS2, at least correctly.
True, but I don't think any browsers follow the HTML specification
exactly either, but that's neither here nor there...

Hypothetically, is there a way to at least indicate if any elements
of CSS2 have been implemented, for example:

<DIV style="visibility: hidden">
<P>Your browser exhibits no support for <SPAN style="display: none"neither CSS1 nor</SPAN> CSS2. Please consider upgrading to the

latest version of your software, or to a browser with
<A href="http://www.w3.org/CSS/#browsers">CSS support</A>.</P>
</DIV>

This should show:

Your browser exhibits no support for CSS2. Please consider upgrading
to the latest version of your software, or to a browser with _CSS
support_.

....with only level 1 support, and this:

Your browser exhibits no support for neither CSS1 nor CSS2. Please
consider upgrading to the latest version of your software, or to a
browser with _CSS support_.

....with no support.

I realise that even if the above would work as intended, it doesn't
guarantee anything other than the presence of a 'visibility'
implementation. However, browser that would implement visibility,
should implement other elements, like positioning (except IE - pile
of crap), overflow, cursors, etc.

This idea would only be used on the entrance page to issue a notice
(like that one presented above) to the user that the content of the
site might not appear as it was meant to be. I'm trying to build
redundancy into my pages: CSS2 if possible, CSS1 to make it look OK,
but not ideal, if not; JavaScript to aid navigation and validation,
alternative pages if it's disabled, etc.

Maybe one day, browser developers will worry about implementing core
functionality (the various web-related specifications) first, then
worry about their own proprietory features afterwards. *sigh* and
pigs might fly...

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #3
Michael Winter wrote:
Is it possible to test for CSS level 2 support, preferably using just
CSS2? For example, the following could alert the user that their
browser doesn't support CSS1 or 2. Is there an equivalent for level 2
only?
<STYLE type="text/css">
DIV#no-css {
display: none;
}
You could do:
DIV[id="no-css"] { ... }

or:
BODY > #no-css { ... }

Of course, that would only test attribute or child selectors. But the
pathetic browsers are those that lack these.
</STYLE>

...

<DIV id="no-css">
<P>Your browser doesn't support cascading style sheets.</P>
</DIV>


Jul 20 '05 #4
Keith Bowes wrote:

or:
BODY > #no-css { ... }

Of course, that would only test attribute or child selectors.


IE/Win will parse body > #no-css as body #no-css (that is, as if it
were a descendent selector). You must remove the space, and have no
punctuation between the 2 parts:

body>div#no-css {
}

(But then, regarding the op, why do all this in the first place? I
see no reason to tell visitors that their browser choice was poorly made.)

--
Brian
follow the directions in my address to email me

Jul 20 '05 #5
Michael Winter wrote:

<DIV id="no-css">
<P>Your browser doesn't support cascading style sheets.</P>
</DIV>


Why do you feel the need to tell some of your visitors that they made
a bad choice of browser?

--
Brian
follow the directions in my address to email me

Jul 20 '05 #6

"Brian" <us*****@julietremblay.com.invalid-remove-this-part> wrote in
message news:bJLxb.246679$9E1.1319532@attbi_s52...
Michael Winter wrote:

<DIV id="no-css">
<P>Your browser doesn't support cascading style sheets.</P>
</DIV>


Why do you feel the need to tell some of your visitors that they made
a bad choice of browser?


In what way does this statement imply a value judgement?

The author is stating that this site is set up using CSS and that's why the
format might look not so nice. I see this as far more of an apologetic
explanation of why the site looks so bland than a reprimand to the user that
their choice of browser is unacceptable.
Jul 20 '05 #7
On Fri, 28 Nov 2003, Neal wrote:
"Brian" <us*****@julietremblay.com.invalid-remove-this-part> wrote in
message news:bJLxb.246679$9E1.1319532@attbi_s52...
Michael Winter wrote:

<DIV id="no-css">
<P>Your browser doesn't support cascading style sheets.</P>
</DIV>
Why do you feel the need to tell some of your visitors that they made
a bad choice of browser?


In what way does this statement imply a value judgement?


Value judgment or not, it goes against the long-standing advice "Don't
mention the mechanics". http://www.w3.org/Provider/Style/

If the reader knows what CSS is, they presumably know whether their
browser supports it or not, and they chose their browser for some good
reason of their own. If they don't know what CSS is, then this
message isn't going to be very informative to them anyway. So, my
"take" on this is that it's likely to annoy those who know what it
means, and serve little useful purpose to those who don't.

I suppose I'd be willing to accept a modest link, in an obscure corner
of the page, that says something like "About this web site", and links
to a separate page where the author says something about his/her
design approach: but if one does that, then it ought at least to be
worded so as to be properly informative to someone who doesn't yet
know what it's about; rather than just telling the better-informed
readers stuff that they already know and that they took into account
when they selected their browser and settings etc., while leaving the
bemused TV-web-appliance etc. users as bemused as they were before.
The author is stating that this site is set up using CSS and that's why the
format might look not so nice.


Almost all of the evidence I've met has told me that readers go to a
web page to find out the information that it contains, not to admire
its visual design. Sure, they like it to look nice too, that's not
the point; but the page itself should concentrate on its information -
the "topic of discourse" to use a technical term. Only if it's a
page about web page design should it be dealing with this kind of
detail, by and large.

CSS is designed to be optional, after all, so if the job's been done
right, there's no need to intrude into their search for information,
with off-topic comments about details of their browser.

IMHO and all that.
Jul 20 '05 #8
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote:
The author is stating that this site is set up using CSS and that's why the
format might look not so nice.


Almost all of the evidence I've met has told me that readers go to a
web page to find out the information that it contains, not to admire
its visual design.


Especially true for search engines. I'm not amused to read this
<http://www.google.com/search?q=cache:www.alltheweb.com>
always when I want to search via AllTheWeb.

--
But thats what FP puts in to the page, so i asume thats correct
Harry H. Arends in microsoft.public.frontpage.client
Jul 20 '05 #9
Alan J. Flavell wrote on 28 Nov 2003:
Value judgment or not, it goes against the long-standing advice
"Don't mention the mechanics".
http://www.w3.org/Provider/Style/

If the reader knows what CSS is, they presumably know whether
their browser supports it or not, and they chose their browser
for some good reason of their own. If they don't know what CSS
is, then this message isn't going to be very informative to them
anyway. So, my "take" on this is that it's likely to annoy
those who know what it means, and serve little useful purpose to
those who don't.

I suppose I'd be willing to accept a modest link, in an obscure
corner of the page, that says something like "About this web
site", and links to a separate page where the author says
something about his/her design approach: but if one does that,
then it ought at least to be worded so as to be properly
informative to someone who doesn't yet know what it's about;
rather than just telling the better-informed readers stuff that
they already know and that they took into account when they
selected their browser and settings etc., while leaving the
bemused TV-web-appliance etc. users as bemused as they were
before.
The author is stating that this site is set up using CSS and
that's why the format might look not so nice.


Almost all of the evidence I've met has told me that readers go
to a web page to find out the information that it contains, not
to admire its visual design. Sure, they like it to look nice
too, that's not the point; but the page itself should
concentrate on its information - the "topic of discourse" to use
a technical term. Only if it's a page about web page design
should it be dealing with this kind of detail, by and large.

CSS is designed to be optional, after all, so if the job's been
done right, there's no need to intrude into their search for
information, with off-topic comments about details of their
browser.


Those are valid points that I hadn't considered (that's why I use
Usenet). My website does display reasonably without /any/ style sheet
support, but if I were in the shoes of such a user, I'd want to know
why the page I'm viewing looks so bad.

I understand that some people disable various technologies by choice,
but they tend to do it for reasons that might not apply in every
case. JavaScript is a common example - avoided completely by a fair
proportion of Internet users. However, disabling JavaScript should
have no impact on a website, at all. Style sheets are slightly
different. They replace the presentational aspects that were removed
(deprecated) from HTML. At least with JavaScript, you might only miss
client-side, rather than server-side validation, or for external
links (that are not obviously external) to appear in a new window
rather than the current one. The site would still work as the author
intended, but the user misses somethings that might be beneficial to
them. With style sheets, the intent is lost entirely. However, I
concede that I'm going about things the wrong way, and I've removed
the notice.

Thank you all for your input. However, just to clarify: the notice in
question wasn't a judgement upon the user. It was purely
informational.

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #10
Michael Winter wrote:
Alan J. Flavell wrote on 28 Nov 2003:
If the reader knows what CSS is, they presumably know whether
their browser supports it or not, and they chose their browser
for some good reason of their own. If they don't know what CSS
is, then this message isn't going to be very informative to them
anyway.
Those are valid points that I hadn't considered (that's why I use
Usenet).
:)
My website does display reasonably without /any/ style sheet
support,

Then you've done a good job of authoring it.
but if I were in the shoes of such a user, I'd want to know why the
page I'm viewing looks so bad.
As suggested, this is best left to a separate page, "site info" or
some such thing, with an unobtrusive link from the main page. If your
site has a "help" section, that seems like a good place to put a more
visible link to the "about this site" page. There, you could include
a small section about the mechanics if you think it would be helpful.
But even there, I would not tell users that their browser is
backwards. Put a positive spin on it: instead of "you see this notice
because your browser does not support the standards," tell them how
their www experience might be better with a more conforming browser.
The one time I did this, I made it a point to say that the visitor's
browsing experience would likely be better on *all* sites, not just mine.
I understand that some people disable various technologies by
choice, but they tend to do it for reasons that might not apply in
every case. JavaScript is a common example - avoided completely by
a fair proportion of Internet users. However, disabling JavaScript
should have no impact on a website, at all. Style sheets are
slightly different.
I'd argue that they should be handled in the same way. They should
add presentation suggestions to the web, adding a little bonus to the
site, if you please. Without css, those little presentation bonuses
are lost, but the core of the site is the same.
with JavaScript, you might only miss client-side, rather than
server-side validation, The site would still work as the author intended, but the user
misses somethings that might be beneficial to them. With style
sheets, the intent is lost entirely.
I'd hope that that is not the case. The intent of any web site should
be the content, not its presentation.
However, just to clarify: the notice in question wasn't a judgement
upon the user. It was purely informational.


You intended it to be informational, that much is clear to me. But
try to put yourself in the user's shoes, particularly in the shoes of
someone not well versed in the mechanics of www authoring. They get
those sorts of messages all the time. My mother, for example, gets
"upgrade" messages from a game site she likes to visit when she uses
Mozilla, which I installed for her because she was tired of pop ups
advertising porn sites. Such messages just serve to confuse her.

I first saw the idea you brought up, a "your browser doesn't support
standards" message, first proposed by WASP. But after reading others
thoughts about such things here, I decided against it.

--
Brian

Jul 20 '05 #11
On Sun, 30 Nov 2003, Brian wrote:

[amongst much with which I agreed:]
I'd hope that that is not the case. The intent of any web site should
be the content, not its presentation.


Indeed. Of course, sometimes web pages are produced whose whole topic
is presentation. So then, "presentation" becomes the content.

But that's where I see no real alternative to offering screen shots,
because you simply cannot take the risk of discussing presentation as
the subject, if you can't rely on the presentation showing as you
intended it. Stylesheets are designed to _not_ do that, and are
therefore in general unsuitable for exhibiting browser results.

This would have to be the notorious "exception which proves the rule",
I think. Something to be looked at as a cautionary special case, but
not used as an excuse for "doing it wrong" on the vast majority of web
pages.

all the best

Jul 20 '05 #12
Brian wrote on 30 Nov 2003:
Michael Winter wrote:


<snip>
The site would still work as the author intended, but the user
misses somethings that might be beneficial to them. With style
sheets, the intent is lost entirely.


I'd hope that that is not the case. The intent of any web site
should be the content, not its presentation.


What I meant was, the presentation is lost entirely.

I'll try and explain what I meant better:

With JavaScript, you add extra interactive features (client-side form
validation, navigational aids, and so forth). With style sheets, you
add presentational features.

Without JavaScript, the forms (should!) be validated server-side, and
navigation will still work. Without style sheets, there is /no/
presentation, at all - only content.

That it what I meant by "lost intent" - there is no fall back when
style sheets are used for presentation, unless you use the HTML
features that CSS replaces.

The purpose of a website shouldn't be lost when it loses it's
presentation, but the author's intentions will be, because he or she
probably didn't picture it being displayed with the user's or
browser's default style sheet. I hope that now you see the
distinction I was trying to present.

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Mike | last post by:
I'm designing a website for some relatives and would like to know if there's a program or something that will show what the web pages will look like on a Mac or other operating systems. I've tested...
4
by: Neil Zanella | last post by:
Hello, I would like to know what the major enhancements of CSS2 over CSS1 are and whether CSS2 support is any better these days than it was a few years ago. In particular, do most browsers fully...
6
by: Charax | last post by:
I maintain an academic web site accessed regularly by schools without the latest equipment. This means that Version 4 IE and NS browsers are frequent visitors. When I validate CSS and HTML,...
6
by: Patrick | last post by:
Hi I am a newbie struggling a little with css.It is hard to get it right in all browsers, so i decided to read the CSS2 specification on the w3 site. What is the following from the CSS2...
20
by: Karl Smith | last post by:
I heard a rumour that Opera succeeded where none have before, and implemented the tables described in HTML4 and CSS2. So I thought I'd try it out with the well known Periodic Table. ...
14
by: Michael Bulatovich | last post by:
Has anyone got a good link to a concise discussion of where things now stand regarding these two? e.g. What browsers are compliant with one or the other? What the adoption rate is of these...
2
by: Xah Lee | last post by:
what's new in CSS2? http://xahlee.org/js/css2.html Xah xah@xahlee.org ∑ http://xahlee.org/
2
by: David E. Ross | last post by:
A new working draft of the CSS2.1 specification was published on-line on 11 April. Does anyone know what changed since the previous (13 June 2005) working draft? -- David E. Ross...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.