无形的对面 [英] Opposite of invisible

查看:99
本文介绍了无形的对面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都知道处理旧浏览器的一个技巧是使用class =old添加额外的

位内容,其中old被定义为display:none in a br / >
@imported样式表,以便旧浏览器永远不会看到它,因此

不要无显示内容。例如,我使用它在NN4等人的导航菜单上添加一个

标题,因为它们无法处理我使用的

CSS-P将菜单移动到一个显而易见的地方,并且不需要标题,并隐藏你应该升级浏览器消息

来自不需要的人。 (如果这太令人困惑,请查看

我的.sig中的URL以及旧的和新的浏览器。)


我是试图想办法与此相反。我希望能够

只向现代浏览器的用户显示某些内容。它不能是一个

JavaScript解决方案,或者依赖于服务器端浏览器嗅探。最好的

我想出的就是做class =" new"其中new被定义为display:none

在LINKed样式表中,以及display:whatever-the-default-在

@imported样式表中。我担心的是,可能有旧的浏览器不会理解(或将会拙劣)显示:无。任何人都可以指向一个

资源来消除这种担忧吗?还有更好的建议吗?


-

Greg Schmidt gr *** @ trawna.com

Trawna出版物 http:// www。 trawna.com/

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

推荐答案

Greg Schmidt写道:
Greg Schmidt wrote:
我们都知道一个处理旧浏览器的技巧是使用class =old添加额外的内容,其中old在
中定义为display:none,在@imported
样式表中旧浏览器永远不会看到它,因此不会无显示内容。我使用这个,例如,在NN4等人的导航菜单上添加一个标题,因为他们无法处理我用来将菜单移动到的CSS-P 一个显而易见且不需要标题的地方,并隐藏你应该升级浏览器的地方。来自不需要的人的消息。 (如果这太混乱了,请查看
我的.sig中的URL与旧的和新的浏览器的示例。)

我正在考虑一种与此相反的方法。我希望能够只为现代浏览器的用户展示某些东西。它不能是JavaScript解决方案,或者依赖于服务器端浏览器嗅探。我来的最好的就是上课=新。其中new被定义为LINKed样式表中的
display:none,以及
显示:whatever-the-default-是@imported样式表单。我担心的是,可能会有旧的浏览器无法理解(或将会拙劣)显示:无。任何人都可以指出一个可以消除这种担忧的资源吗?任何更好的建议?
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?




显示:阻止和显示:内联,以适用于元素的元素为准。


-

Els http:// locusmeus .com /

Sonhos vem。 Sonhos v?o。 Orestoébritfeito。

- Renato Russo -

现在播放:George Baker Selection - 小绿袋



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


2004年7月20日星期二18:19:21 -0400,Greg Schmidt< gr *** @ trawna.com>写道:
On Tue, 20 Jul 2004 18:19:21 -0400, Greg Schmidt <gr***@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.




取决于*你想要的新浏览器的方式要显示,你或许可以使用生成的内容
。以下是至少Gecko,Opera和

KHTML的支持。 IE(Windows,关于Mac版本的dunno)没有线索。


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


#someid:在{

内容:"此文本将显示" ;;

display:block; / *''内联''也可以使用* /

}


-

什么是'如果它糟透了就逃避现实的错误?!"

- 真嗣伊卡里,新世纪福音战士



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


Greg Schmidt写道:
Greg Schmidt wrote:
display:none,以便旧的浏览器永远不会看到它,因此不会无。显示内容。例如,我使用它在NN4等人的导航菜单上添加标题,因为他们无法处理我用来将菜单移动到一个地方的CSS-P
很明显,
不需要标题,


好​​的。

并隐藏你应该升级你的浏览器"来自不需要的人的消息。


你为什么要告诉人们他们应该升级呢?

我正试图想办法与此相反。我想
只能向现代浏览器的用户展示某些东西。


为什么要尝试排除NS4等用户的内容?

我担心的是可能有旧浏览器不理解
(或将拙劣)显示:无。
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.




我不知道。但我认为你的担忧是错误的。你应该担心你的创作原则有点歪曲。


不管你的访问者使用哪种浏览器,以及它是否符合

您的标准。除了在一组合理的

浏览器中测试代码之外,你不应该对任何特定的浏览器特别支持或不支持。


-

Brian(删除.invalid给我发电子邮件)
http://www.tsmchughs.com/


这篇关于无形的对面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆