Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





Pages (2): [1] 2 »   Last Thread  Next Thread
Author
Thread Post New Thread   

Opposite of invisible
 

Greg Schmidt




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 12:18 AM  
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@trawna.com
Trawna Publications  http://www.trawna.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Els




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 03:50 AM  
Greg Schmidt wrote:

> 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


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Karri Kahelin




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 03:50 AM  
On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gregs@trawna.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 */
}

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


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Brian




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 03:50 AM  
Greg Schmidt wrote:

> 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,

Ok.

> 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?

> 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?

> My concern is that there may be old browsers that won't understand
> (or will botch) display:none.

I don't know of any. But your concern is misplaced, I think. You
should be concerned that your authoring principles are a bit askew.

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.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Greg Schmidt




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 09:16 AM  
On Tue, 20 Jul 2004 21:55:09 -0400, Brian wrote:

> Greg Schmidt wrote:
> 
>
> 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!
 
>
> 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.)

> 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@trawna.com
Trawna Publications  http://www.trawna.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Greg Schmidt




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 09:16 AM  
On Wed, 21 Jul 2004 01:57:30 +0300, Karri Kahelin wrote:

> On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gregs@trawna.com> wrote:
> 
>
> 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@trawna.com
Trawna Publications  http://www.trawna.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Brian




quote this post edit post

IP Loged report this post

Old Post  07-21-04 - 09:16 AM  
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".

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.

> Why people should or should not upgrade is a discussion that's been
> done to death, let's not start it again!

I don't know why your telling me this. You already brought it up, and
you continue to rehash the same points further down in this message.

> 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.

> 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.
 
>
> 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.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Greg Schmidt




quote this post edit post

IP Loged report this post

Old Post  07-22-04 - 12:17 AM  
On Wed, 21 Jul 2004 02:30:19 -0400, Brian wrote:

> Greg Schmidt wrote: 
>
> 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.

> 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.
 
>
> 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.
 
>
> 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.
 
>
> 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@trawna.com
Trawna Publications  http://www.trawna.com/


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Neal




quote this post edit post

IP Loged report this post

Old Post  07-22-04 - 12:17 AM  
On Wed, 21 Jul 2004 14:44:45 -0400, Greg Schmidt <gregs@trawna.com> wrote:


> 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.


Post Follow-Up to this message ]
Re: Opposite of invisible
 

Alan J. Flavell




quote this post edit post

IP Loged report this post

Old Post  07-22-04 - 12:17 AM  
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?

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.

> 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.

> 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.



Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 04:35 AM. Post New Thread   
Pages (2): [1] 2 »   Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top