Firefox 4所需的输入格式为RED边框/大纲 [英] Firefox 4 Required input form RED border/outline

查看:153
本文介绍了Firefox 4所需的输入格式为RED边框/大纲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开发了一个HTML5 jQuery插件,我无法在FF4测试版中删除必填字段的红色边框。

I have recently developed an HTML5 jQuery plugin and I'm having trouble removing the red border on required fields in FF4 beta.

我注意到FF应用此边框/ outline在必填字段中,并在设置值时将其删除。问题是,我使用value属性来模拟旧版浏览器中的占位符attr。因此,我需要所有输入与此功能不显示红线。

I noticed that FF applies this border/outline in required fields and removes it when value is set. The problem is that I am using the value attribute to emulate the placeholder attr in older browsers. Therefore I need all inputs with this feature to not show the red line.

您可以看到 plugin here

推荐答案

有一些新的伪选择器一些新的HTML5表单功能在CSS中可用。你可能在寻找:invalid 。以下全部来自 MDC Firefox 4文档

There's some new pseudo selectors for some of the new HTML5 form features available to you in CSS. You're probably looking for :invalid. The following are all from the MDC Firefox 4 docs:


  • :invalid CSS伪类自动应用于内容无法根据输入的类型设置

  • The :invalid CSS pseudo-class is applied automatically to elements whose contents fail to validate according to the input's type setting

: - moz-submit-invalid 伪类别是
应用于表单
上的提交按钮,当一个或多个表单字段
未验证时。

The :-moz-submit-invalid pseudo-class is applied to the submit button on form fields when one or more form fields doesn't validate.

:required
伪类现在自动
字段
指定必需的属性;
:可选伪类应用于
所有其他字段。

The :required pseudo-class is now automatically applied to fields that specify the required attribute; the :optional pseudo-class is applied to all other fields.


: - moz-placeholder 伪类别

: - moz-focusring pseudo-selector
让你指定一个
元素的外观,当Gecko认为
元素应该有一个焦点
指示呈现。

The :-moz-focusring pseudo-selector lets you specify the appearance of an element when Gecko believes the element should have a focus indication rendered.

这篇关于Firefox 4所需的输入格式为RED边框/大纲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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