HighDots Forums  

Opposite of invisible

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Opposite of invisible in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greg Schmidt
 
Posts: n/a

Default Opposite of invisible - 07-20-2004 , 06:19 PM






We all know that one trick in dealing with old browsers is to add extra
bits of content with class="old", where old is defined as display:none in a
style sheet that is @imported so that old browsers never see it and hence
don't "none" the display of the content. I use this, for example, to put a
heading on my navigation menu in NN4 et al, because they can't handle the
CSS-P that I use to move the menu to a place where it's obvious and doesn't
need a heading, and to hide the "You should upgrade your browser" message
from people who don't need to. (If this is too confusing, check the URL in
my .sig with an old and a new browser for an example.)

I'm trying to think of a way to do the opposite of this. I want to be able
to show certain things only to users of modern browsers. It can't be a
JavaScript solution, or rely on server-side browser sniffing. The best
I've come up with is to do class="new" where new is defined as display:none
in the LINKed style sheet, and as display:whatever-the-default-is in the
@imported style sheet. My concern is that there may be old browsers that
won't understand (or will botch) display:none. Can anyone point me to a
resource that will allay this concern? Any better suggestions?

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/

Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: Opposite of invisible - 07-20-2004 , 06:29 PM






Greg Schmidt wrote:

Quote:
We all know that one trick in dealing with old browsers is
to add extra bits of content with class="old", where old is
defined as display:none in a style sheet that is @imported
so that old browsers never see it and hence don't "none"
the display of the content. I use this, for example, to
put a heading on my navigation menu in NN4 et al, because
they can't handle the CSS-P that I use to move the menu to
a place where it's obvious and doesn't need a heading, and
to hide the "You should upgrade your browser" message from
people who don't need to. (If this is too confusing, check
the URL in my .sig with an old and a new browser for an
example.)

I'm trying to think of a way to do the opposite of this. I
want to be able to show certain things only to users of
modern browsers. It can't be a JavaScript solution, or
rely on server-side browser sniffing. The best I've come
up with is to do class="new" where new is defined as
display:none in the LINKed style sheet, and as
display:whatever-the-default-is in the @imported style
sheet. My concern is that there may be old browsers that
won't understand (or will botch) display:none. Can anyone
point me to a resource that will allay this concern? Any
better suggestions?
display:block and display:inline, whichever is appropriate for
the element.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: George Baker Selection - Little Green Bag


Reply With Quote
  #3  
Old   
Karri Kahelin
 
Posts: n/a

Default Re: Opposite of invisible - 07-20-2004 , 06:57 PM



On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gregs (AT) trawna (DOT) com> wrote:

Quote:
I'm trying to think of a way to do the opposite of this. I want to be
able
to show certain things only to users of modern browsers.
Depending on *how* new browsers you want it to show, you might be able to
use generated content. Following is supported by at least Gecko, Opera and
KHTML. IE (Windows, dunno about Mac versions) doesn't have a clue.

<div id="someid"></div>

#someid:after{
content: "This text will be shown";
display: block; /* 'inline' would work, too */
}

--
"What's wrong with running away from reality if it sucks?!"
- Shinji Ikari, Neon Genesis Evangelion


Reply With Quote
  #4  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 12:57 AM



On Tue, 20 Jul 2004 21:55:09 -0400, Brian wrote:

Quote:
Greg Schmidt wrote:

and to hide the "You should upgrade your browser" message from
people who don't need to.

Why are you telling people they should upgrade?
Ah, I knew I should have used the full text. What I actually say is "This
site will look much better in a browser that supports current web
standards." I tell them that because it's true. :-) Why people should or
should not upgrade is a discussion that's been done to death, let's not
start it again!

Quote:
I'm trying to think of a way to do the opposite of this. I want to
be able to show certain things only to users of modern browsers.

Why are you trying to exclude content from users of NS4 et al?
I'm not trying to exclude content. I don't actually have a use for it
right now, but thought it was an interesting exercise, and might be useful
down the road. For example, if I had (as I tried at one point) a method of
switching style sheets but it only changed styles that are hidden from NN4
(because they break it badly), then there is no point in users of NN4
getting their hopes up and then thinking my site is broken when nothing
visibly changes.

As another (contrived) example, I might want to congratulate a visitor on
using a browser that does support current web standards, and clearly
showing this message to someone using NN4 would be inappropriate! (Then
again, showing it to anyone using any version of IE would also be
inappropriate, but that is also another topic... Karri's solution may be
highly appropriate in this case.)

Quote:
Fret not about which browser your visitors use, and whether it meets
your standards. Beyond testing the code in a reasonable set of
browsers, you should do nothing in particular for or against any
particular browser.
My visitors use a wide variety of browsers, so I cannot reasonably ignore
anything before 4th generation (including MSN TV). My HTML is laid out in
what I believe is a highly accessible manner (content first, then
navigation). To get the look I want, I use modern CSS techniques
(specifically CSS-P) which old browsers cannot handle. If I do nothing in
particular for those old browsers, then the site becomes completely
unusable, with things overlapping other things. So, I separate what works
for all browsers from what works only with modern browsers, LINK the former
and @import the latter. I then take some very small steps to make it as
usable as possible in both sets.

If you think this is the wrong way to go, feel free to check the site in my
..sig, which represents the best compromise I've found so far, and make
specific comments about what you would do differently.

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/


Reply With Quote
  #5  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 12:57 AM



On Wed, 21 Jul 2004 01:57:30 +0300, Karri Kahelin wrote:

Quote:
On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gregs (AT) trawna (DOT) com> wrote:

I'm trying to think of a way to do the opposite of this. I want to be
able
to show certain things only to users of modern browsers.

Depending on *how* new browsers you want it to show, you might be able to
use generated content. Following is supported by at least Gecko, Opera and
KHTML. IE (Windows, dunno about Mac versions) doesn't have a clue.

div id="someid"></div

#someid:after{
content: "This text will be shown";
display: block; /* 'inline' would work, too */
}
I'd considered this, but it has some problems.

First, it is not generic. I'd have to create one of these for each thing I
wanted to make invisible to old browsers. (Not that I expect there would
be many, but as a programmer raised on reusability it strikes a bad chord
with me.)

Second, when I played with generated content a while ago, I was unable to
include any HTML (e.g. a link) in the generated content. This may have
been an error in my implementation or a known limitation; I didn't really
need it at the time, so I didn't bother to track it down.

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/


Reply With Quote
  #6  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 02:44 PM



On Wed, 21 Jul 2004 02:30:19 -0400, Brian wrote:

Quote:
Greg Schmidt wrote:
Brian wrote:

What I actually say is "This site will look much better in a
browser that supports current web standards." I tell them that
because it's true. :-)

It's still unlikely that they care. Probably unlikely that all of them
understand the message to begin with. Only web geeks like ciwa*
regulars care about "standards".
They may care that my site (and perhaps by implication other sites) don't
look as good as they might, or they may not care. If they care, maybe
they'll ask their local computer expert what they can do about it. If they
don't care, they'll ignore the message and no harm done.

Quote:
Nor have you thought this through. I just loaded your home page in
Mozilla 0.8, with css disabled. True, 0.8 is not bleeding edge, but it
can certainly claim to support web standards as well or better than
most browsers. (Lynx might have an edge on HTML; Opera on CSS; I think
the DOM crown belongs to Mozilla.) Yet, even though it is a modern
browser that supports current web standards, there's your message,
looking rather silly.
I would argue that by disabling CSS, you have turned your browser into
something that does not support current standards. I think the message is
perfectly appropriate in this case. I'd also argue that "only web geeks
like ciwa* regulars" know how to disable CSS in their browser, and they
know what to expect when they do so.

Quote:
I'm not trying to exclude content. I don't actually have a use for
it right now, but thought it was an interesting exercise, and
might be useful down the road.

You might have told us that up front.
Yes, I should have. Sorry for the confusion that this was a real-world
problem instead of a learning exercise.

Quote:
As another (contrived) example, I might want to congratulate a
visitor on using a browser that does support current web standards,
and clearly showing this message to someone using NN4 would be
inappropriate!

Showing such a message to anyone is inappropriate, unless your site is
about upgrading browsers.
I did say it was a contrived example. Trying (and apparently failing) to
be funny, as much as anything. As you say, this particular example would
be of very limited use.

Quote:
Beyond testing the code in a reasonable set of browsers, you
should do nothing in particular for or against any particular
browser.

If I do nothing in particular for those old browsers, then the site
becomes completely unusable, with things overlapping other things.

I could have been clearer. Let me try again:

Beyond testing the code in a reasonable set of browsers and making
code adjustments to protect them from their bugs, you should do
nothing in particular for or against any particular browser. "This
site works best in..." is not accounting for bugs. It's casting
judgement on the user's software.
Nowhere in this thread or on my site do I say that the site works best in
any particular browser. It is perfectly usable in all browsers I have
tested with (about a dozen). It *looks better* in some than in others.

I think that when you say "making code adjustments to protect them from
their bugs" you mean essentially the same as I did when I said (deleted in
your post) "I separate what works for all browsers from what works only
with modern browsers". That and the (paraphrased) "this site could look
better" message are all that I do to account for different browsers.

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/


Reply With Quote
  #7  
Old   
Neal
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 03:42 PM



On Wed, 21 Jul 2004 14:44:45 -0400, Greg Schmidt <gregs (AT) trawna (DOT) com> wrote:


Quote:
I would argue that by disabling CSS, you have turned your browser into
something that does not support current standards.
You may argue this, but you'd be wrong. CSS is designed to be an optional
enhancement of the HTML document, not an integral, mandatory aspect of
your content.


Reply With Quote
  #8  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 04:01 PM



On Wed, 21 Jul 2004, Greg Schmidt wrote:

Quote:
I would argue that by disabling CSS, you have turned your browser into
something that does not support current standards.
You're implying that all of your current browsers support, for
example, all of CSS2 aural stylesheets? If not, why not?

Fact is, CSS always was and still is intended to be optional:
available to be applied per specification in browsing situations where
it's appropriate, while able to be ignored / switched off in
situations where it's being a nuisance.

Quote:
I'd also argue that "only web geeks
like ciwa* regulars" know how to disable CSS in their browser,
Maybe you haven't met any users with special needs.

And quite a number of folks who I'd style as "ordinary users" have
found the "web developer toolbar" for Mozilla/Firefox and are using it
to adjust their web browsing experience. I've heard them recommending
it to each other, like "hey you don't have to be a web developer to
use this...". I'm not making this up.

Quote:
Nowhere in this thread or on my site do I say that the site works best in
any particular browser. It is perfectly usable in all browsers I have
tested with (about a dozen). It *looks better* in some than in others.
That's just fine, in the terms that you just said it, but I'm having a
hard time seeing it jive with the rest of what you said.



Reply With Quote
  #9  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 10:22 PM



On Wed, 21 Jul 2004 21:01:51 +0100, Alan J. Flavell wrote:

Quote:
On Wed, 21 Jul 2004, Greg Schmidt wrote:

I would argue that by disabling CSS, you have turned your browser into
something that does not support current standards.

You're implying that all of your current browsers support, for
example, all of CSS2 aural stylesheets? If not, why not?
An argument could be made that, since none of the browsers I use support
speech (I know, I should get one and test with it, it's on the todo list),
they do in fact fully support all facets of CSS2 aural stylesheets that
apply to the way they render pages. It would be a stupid, facetious
argument, and I sure wouldn't make it, but somebody might. :-)

Quote:
Fact is, CSS always was and still is intended to be optional:
available to be applied per specification in browsing situations where
it's appropriate, while able to be ignored / switched off in
situations where it's being a nuisance.
If only it really was "applied per specification", life would be so much
easier. NN4 would just ignore large chunks of my stylesheets instead of
botching them with guesses. There wouldn't be "IE box model" hacks. In
short, there would be much rejoicing and eating of minstrels.

Quote:
I'd also argue that "only web geeks
like ciwa* regulars" know how to disable CSS in their browser,

Maybe you haven't met any users with special needs.
No, you're quite right, I haven't. I was simply echoing Brian's hyperbole:

Quote:
Only web geeks like ciwa*
regulars care about "standards".
In fact, after I've explained the benefits to them, quite a number of
non-"web geeks" have come to care about and embrace standards. Or by doing
so have they become web geeks (in which case the statement becomes
analagous to "only authors write books" -- true, but meaningless).

Quote:
Nowhere in this thread or on my site do I say that the site works best in
any particular browser. It is perfectly usable in all browsers I have
tested with (about a dozen). It *looks better* in some than in others.

That's just fine, in the terms that you just said it, but I'm having a
hard time seeing it jive with the rest of what you said.
I don't know what parts don't jive for you. In my mind, it's all
consistent, so I guess there's been a misunderstanding (which I'm quite
willing to accept the blame for) somewhere along the line.

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/


Reply With Quote
  #10  
Old   
Greg Schmidt
 
Posts: n/a

Default Re: Opposite of invisible - 07-21-2004 , 10:23 PM



On Wed, 21 Jul 2004 18:25:15 -0400, Brian wrote:

Quote:
Greg Schmidt wrote:

Nowhere in this thread or on my site do I say that the site works
best in any particular browser.

It looks like you have, almost. "This site looks better in a modern
browser" is one small step away from "This site optimized for Netscape
4".
I think it's a pretty big step, actually. Just as far away, IMHO, as the
"A modern browser may improve the visual appearance of this site" from the
site you mention below. Back in the day, "Optimized for NN4" typically
meant that it wouldn't work with anything else. Not even counting Netscape
(or Opera) v6 as distinct from v7, there are probably 10+ browsers that
count as "modern"; my site works (AFAIK) with all of them, and degrades
gracefully (fully functional, but less appealing) in (again, AFAIK) all
other browsers.

I thought it was the whole concept of a message like this that you objected
to, but since you also use one, that can't be it. I'm confused how my
"This site will look much better in a browser that supports current web
standards" is substantially different in meaning from your "A modern
browser may improve the visual appearance of this site" It can't be simply
that I say "will" and you say "may". Is it because I mention "standards"
but you say "modern"? No, you use "modern" above in your example of how
not to do it.

Quote:
[...] there is a message
on every page of cool designer's site, telling users how to make his
site look better. As if that might matter to Jill User.
Ah, so it is because you have a page dedicated to explaining why (which
gives the user no way of telling whether they in fact have a modern
browser), while I had (yes, past tense) the sentence on every page (but
invisible to those who already have a modern browser)? If so, is there a
consensus that this is the best way to do it?

Quote:
Instead of "my site will look
better if you get Flurbet v 87.3.21.a browser", the message is "this
site should work in any HTML browser".
Now you're just twisting my words. I have never had a message that
recommended any particular browser. (Okay, one of my personal pages
mentions that I use Opera and hence don't care if it looks sub-par in IE,
but since the bulk of traffic there is me, I don't think it counts.) I
supported the "Any Browser" campaign way back when, and I've stuck to those
same ideals all along, even before it began. Lynx has always been one of
my test platforms.

If I've said anything to give any other impression, then I have not
expressed myself well. It wouldn't be the first time. :-)

--
Greg Schmidt gregs (AT) trawna (DOT) com
Trawna Publications http://www.trawna.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.