473,788 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opposite of invisible

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:whateve r-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 gr***@trawna.co m
Trawna Publications http://www.trawna.com/
Jul 20 '05 #1
15 4871
Els
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:whateve r-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
Jul 20 '05 #2
On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gr***@trawna.c om> 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
Jul 20 '05 #3
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/
Jul 20 '05 #4
On Tue, 20 Jul 2004 21:55:09 -0400, Brian wrote:
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!
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.)
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 gr***@trawna.co m
Trawna Publications http://www.trawna.com/
Jul 20 '05 #5
On Wed, 21 Jul 2004 01:57:30 +0300, Karri Kahelin wrote:
On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gr***@trawna.c om> 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 gr***@trawna.co m
Trawna Publications http://www.trawna.com/
Jul 20 '05 #6
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.
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.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #7
On Wed, 21 Jul 2004 02:30:19 -0400, Brian wrote:
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.
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.
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.
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.
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 gr***@trawna.co m
Trawna Publications http://www.trawna.com/
Jul 20 '05 #8
On Wed, 21 Jul 2004 14:44:45 -0400, Greg Schmidt <gr***@trawna.c om> 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.
Jul 20 '05 #9
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.

Jul 20 '05 #10

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

Similar topics

10
10117
by: Cy | last post by:
I've had good luck with posting in the past, so we'll see how things go this time...:) I have an Access 2000 form. On the form is about 40 objects. I want to set everything to invisible, except a drop down box. Once the user selects from the pull down menu, I have code that picks the applicable fields to be visible. Thus, if a user makes changes to the pull down menu, ie. changes the value in the pull down, I need everything to go...
3
4891
by: Jose_Csharp | last post by:
Hi guys, I´m trying to make a startup invisible form. I don´t want a form with Opacity property 0. First I did the property Visible of the form to false. It wasn´t a good idea, was too easy. Then I follow the tips of MSDN making a new class with an instance of the form that has the logical of the application. But it not run since I call the ShowDialog() method. Please, can anyone gime me a tip or any web with an example? I´m a newbie.
3
2163
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am kinda stuck there. but this is basicly what i want. if Username = "Deleted_User" then 'make entire table row invisible. End if
3
2901
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value" Visible=False runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.min_value") %>'> </asp:Label>
0
1143
by: Fir5tSight | last post by:
Hi All, Again I apologize for posting this topic at the wrong forum, because I don't know where else I can get help on this matter. This is about invisible lines and rectangles in a PDF file. Other developers used "Active Reports" API in Visual Basic to create the PDF file. Since they set some sections to "visible = false", the lines/rectangles in those sections are therefore invisible in the PDF file.
7
7025
by: Nader | last post by:
It's easy to make the last row in a datagrid (filled with a table) invisible: datagridObject.Rows.Visible = false BUT if 'i' is not the last row then things go wrong. I even tried: for (int i = datagridObject.Rows.Count - 1; i >= 0; i-- ) {
9
4793
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters against one of those invisible columns. How do I accomplish this? The code below that I attempted just returns an empty string when I try to retrieve the invisible column data: gvParts.Rows(e.RowIndex).Cells(8).Text
5
7296
by: my.shabby.sheep | last post by:
Hi, I want to do the following. I want to make a table column invisible to the screen, but I still want to be able to get the innertext that would have been stored in the cell for certain operations. What would be the best way to do this. I currently added an invisible attribute to the column tag. Please help
11
9052
by: igor.tatarinov | last post by:
Given a bunch of arrays, if I want to create tuples, there is zip(arrays). What if I want to do the opposite: break a tuple up and append the values to given arrays: map(append, arrays, tupl) except there is no unbound append() (List.append() does not exist, right?). Without append(), I am forced to write a (slow) explicit loop: for (a, v) in zip(arrays, tupl): a.append(v)
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.