class-Attribut +:after - >内容 [英] class-Attribut + :after -> content

查看:88
本文介绍了class-Attribut +:after - >内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想用类无效标记输入元素通过附上

的东西,比如说?。我的理解是它应该像

这样工作:


input.invalid:在{

内容:"?" ;;

}


但是,至少在Firefox(1.0.4)和Konqueror(3.4.1)中它没有

工作。有没有我在这里缺少的东西,或者在这两个实施中都是错误的吗?


Michael


-

迈克尔Schuerig没有什么是出色的适应性

mailto:mi ***** @ schuerig.de作为选择性愚蠢。
http://www.schuerig.de/michael/ --AO Rorty,欺骗性的自我


I''d like to mark input elements with class "invalid" by appending
something, say a "?". My understanding is that it should work like
this:

input.invalid:after {
content:"?";
}

However, at least in Firefox (1.0.4) and Konqueror (3.4.1) it does not
work. Is there something I''m missing here or is this an error in both
implementations?

Michael

--
Michael Schuerig Nothing is as brilliantly adaptive
mailto:mi*****@schuerig.de as selective stupidity.
http://www.schuerig.de/michael/ --A.O. Rorty, The Deceptive Self

推荐答案

Michael Schuerig< mi ***** @ schuerig.de>写道:
Michael Schuerig <mi*****@schuerig.de> wrote:
我想用类无效标记输入元素。通过追加
某事,说出?。我的理解是它应该像
这样工作:

input.invalid:after {
content:"?" ;;
}
<但是,至少在Firefox(1.0.4)和Konqueror(3.4.1)中它确实不起作用。在这两个实现中是否有我缺少的东西或这是一个错误
I''d like to mark input elements with class "invalid" by appending
something, say a "?". My understanding is that it should work like
this:

input.invalid:after {
content:"?";
}

However, at least in Firefox (1.0.4) and Konqueror (3.4.1) it does
not work. Is there something I''m missing here or is this an error
in both implementations?




:after元素和生成的内容(content属性)

目前支持不足。我猜Opera是唯一支持它们的相对

广泛的浏览器。


另一方面,我会说标记字段的想法

方式根本不健全。请记住CSS警告:CSS仅适用于

关于演示的可选建议;他们可以被忽略或

被覆盖。由于用户可能必须知道哪些字段的内容不正确,因此应以实际的

内容表示,而不是生成的内容。


-

Yucca, http://www.cs.tut.fi/~jkorpela/


Jukka K. Korpela写道:
Jukka K. Korpela wrote:
Michael Schuerig< mi ***** @ schuerig.de>写道:
Michael Schuerig <mi*****@schuerig.de> wrote:
我想用类无效标记输入元素。通过追加
某事,说出?。我的理解是它应该像
这样工作:

input.invalid:after {
content:"?" ;;
}
<但是,至少在Firefox(1.0.4)和Konqueror(3.4.1)中它确实不起作用。在这两个实现中是否有我缺少的东西或者这是一个错误?
:元素和生成的内容(内容属性)目前支持不足。我猜Opera是唯一支持它们的相对广泛的浏览器。
I''d like to mark input elements with class "invalid" by appending
something, say a "?". My understanding is that it should work like
this:

input.invalid:after {
content:"?";
}

However, at least in Firefox (1.0.4) and Konqueror (3.4.1) it does
not work. Is there something I''m missing here or is this an error
in both implementations?
The :after element and generated content (the content property) are
poorly supported at present. I guess Opera is the only relatively
widespread browser that supports them.




令人惊讶的是,各个CSS规则都可以正常工作。

另一方面,我会说,标记字段的想法根本不健全。记住CSS警告:CSS仅用于演示的可选建议;它们可以被忽略或被覆盖。由于用户可能必须知道哪些字段包含不正确的内容,因此应以实际内容表示,而不是生成内容。



The surprising thing is that the individual pieces of CSS rule all work.
On the other hand, I would say that the idea of flagging fields that
way is not robust at all. Remember the CSS caveats: CSS is just for
optional suggestions on presentation; they can be ignored or
overridden. Since it is presumably essential to the user to know which
fields have incorrect content, this should be expressed in actual
content, not generated content.




它仅用于标记客户端验证错误。如果那个

不起作用,那么就会有服务器端验证和随附的

通知回落。


迈克尔


-

Michael Schuerig没有什么是出色的适应性

mailto:mi ***** @ schuerig.de选择性愚蠢。
http://www.schuerig.de/michael/ --AO Rorty,欺骗性的自我



It''s only meant for flagging client-side validation errors. If that
doesn''t work, there is server-side validation and accompanying
notification to fall back to.

Michael

--
Michael Schuerig Nothing is as brilliantly adaptive
mailto:mi*****@schuerig.de as selective stupidity.
http://www.schuerig.de/michael/ --A.O. Rorty, The Deceptive Self


Michael Schuerig< mi ***** @ schuerig.de>写道:
Michael Schuerig <mi*****@schuerig.de> wrote:
我想用类无效标记输入元素。通过追加
某事,说出?。我的理解是它应该像
这样工作:

input.invalid:after {
content:"?" ;;
}
<但是,至少在Firefox(1.0.4)和Konqueror(3.4.1)中它不起作用。是否有我在这里缺少的东西或这两个
实现中的错误?
I''d like to mark input elements with class "invalid" by appending
something, say a "?". My understanding is that it should work like
this:

input.invalid:after {
content:"?";
}

However, at least in Firefox (1.0.4) and Konqueror (3.4.1) it does not
work. Is there something I''m missing here or is this an error in both
implementations?




适用于Opera和Mozilla 1.5。不在FF 1.0.4(错误)。


-

Spartanicus



Works in Opera and Mozilla 1.5. Not in FF 1.0.4 (bug).

--
Spartanicus


这篇关于class-Attribut +:after - &gt;内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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