iso-3166-伪2

The following is an extract from our book, HTML5 & CSS3 for the Real World, 2nd Edition, written by Alexis Goldstein, Louis Lazaris, and Estelle Weyl. Copies are sold in stores worldwide, or you can buy it in ebook form here.

以下摘自Alexis Goldstein,Louis Lazaris和Estelle Weyl编写的《现实世界HTML5和CSS3,第二版 》一书。 副本在世界各地的商店中都有出售,您也可以在这里以电子书的形式购买。

伪类 (Pseudo-classes)

It’s likely that you’re already familiar with some of the user interaction pseudo-classes, namely :link, :visited, :hover, :active, and :focus.

您可能已经熟悉一些用户交互伪类,即:link:visited:hover:active:focus

重要事项:注意事项 (Important: Key Points to Note)

There are security issues the :visited pseudo-class can pose, so browsers do not support all CSS properties on visited links. Without these limitations, malicious sites could apply a style to a visited link, such as a unique background image for each visited link, to check whether popular sites or banks have been visited by the user. This allows the attacker to glimpse the user’s browsing history without their permission. As a result, modern browsers limit the styles that can be applied with :visited.

:visited伪类可能带来安全问题,因此浏览器不支持访问的链接上的所有CSS属性。 在没有这些限制的情况下,恶意站点可以对访问的链接应用一种样式,例如为每个访问的链接提供唯一的背景图像,以检查用户是否访问了受欢迎的站点或银行。 这使攻击者无需他们的许可即可浏览用户的浏览历史记录。 结果,现代浏览器限制了:visited可以应用的样式。

The spec explicitly condones these changes, saying: UAs [User Agents] may, therefore, treat all links as unvisited links, or implement other measures to preserve the user’s privacy while rendering visited and unvisited links differently.

规范明确允许这些更改,说:UA [用户代理]可以将所有链接视为未访问的链接,或实施其他措施来保护用户的隐私,同时以不同的方式呈现已访问和未访问的链接。

For better accessibility, add :focus wherever you include :hover as not all visitors will use a mouse to navigate your site.

为了获得更好的可访问性,请在包括:hover任何地方添加:focus因为并非所有访问者都会使用鼠标来导航您的站点。

:hover can apply to any element on the page not just links and form controls.

:hover可以应用于链接和表单控件,还可以应用于页面上的任何元素。

:focus and :active are relevant to links, form controls, content editable elements, and any element with a tabindex attribute.

:focus:active与链接,表单控件,内容可编辑元素以及具有tabindex属性的任何元素有关。

While it’s likely you’ve been using these basic pseudo-classes for some time, there are many others available. Several of these pseudo-classes have been in the specification for years, but weren’t supported (or commonly known) until browsers started supporting the new HTML5 form attributes that made them more relevant.

虽然您可能已经使用这些基本伪类一段时间了,但还有许多其他可用的方法。 这些伪类中的几种已经在规范中使用了多年,但直到浏览器开始支持使它们更加相关的新HTML5表单属性时,才被支持(或众所周知)。

The following pseudo-classes match elements based on attributes, user interaction, and form control state:

以下伪类根据属性,用户交互和表单控件状态来匹配元素:

:enabled A user interface element that’s enabled, which is basically any form control that supports the disabled attribute but doesn’t currently have it applied.

:enabled的用户界面元素,基本上是任何支持disabled属性但当前未应用该属性的窗体控件。

:disabled Conversely, a user interface element that is disabled: any form control that supports the disabled attribute and currently has it applied.

:disabled相反, :disabled的用户界面元素disabled:任何支持disable属性并且当前已应用该属性的窗体控件。

:checked For radio buttons or checkboxes that are selected or ticked.

:checked对于:checked或勾选的单选按钮或复选框。

:indeterminate For form elements that are neither checked nor unchecked. For example, if you tick a check all checkbox to select a group of checkboxes, then deselect some but not all of the checkboxes in the group, the check all could be set to the indeterminate state (with JavaScript) to indicate that it’s neither checked nor unchecked.

:indeterminate对于未选中或未选中的表单元素。 例如,如果您勾选了“全部选中”复选框以选择一组复选框,然后取消选择了该组中的某些但不是全部复选框,则可以将“全部选中”设置为不确定状态(使用JavaScript)以表明未选中也没有检查。

:target This selector singles out the element that is the target of the currently active intrapage anchor. That sounds more complicated than it is: you already know that you can have links to anchors within a page by using the # character with the ID of the target. For example, you may have Skip to content link in your page that, when clicked, will jump to the element with an ID of content.

:target此选择器将选择作为当前活动页内锚点目标的元素。 这听起来比实际要复杂:您已经知道可以通过使用#字符和目标ID来链接到页面内的锚点。 例如,您可能在页面中具有“ 跳至内容”链接,单击该链接将跳至具有内容ID的元素。

This changes the URL in the address bar to thispage.html#contentand the :target selector now matches the element in the document that has content as its ID. It’s as if you had included, temporarily, the selector #content. We say temporarily because as soon as the user clicks on a different anchor, :target will match the new target.

这会将地址栏中的URL更改为thispage.html#contentand the :target选择器现在与以ID为内容的文档中的元素匹配。 就像您暂时包含了选择器#content一样。 我们之所以说是暂时的,是因为用户单击其他锚点后, :target将匹配新的目标。

:default Applies to one or more UI elements that are the default among a set of similar elements. For example, the one radio button in a group of same-named radio buttons that was checked on page load will continue to match :default after another radio button in the same-named group is selected. Similarly, checkboxes that are selected on page load will continue to match :default after they are unchecked.

:default适用于一个或多个UI元素,它们是一组相似元素中的默认元素。 例如,在页面加载时选中的一组同名单选按钮中的一个单选按钮将继续匹配:default after another radio button in the same-named group is selected. Similarly, checkboxes that are selected on page load will continue to match after another radio button in the same-named group is selected. Similarly, checkboxes that are selected on page load will continue to match :default

:valid Applies to elements that are valid, based on the type, pattern, or other input attributes (as we discussed in Chapter 4).

:valid适用于基于类型,模式或其他输入属性的有效元素(如我们在第4章中所述)。

:invalid Applies to empty required elements and elements failing to match the requirements defined by the type or pattern attributes.

:invalid适用于清空必需的元素以及不符合类型或模式属性定义的要求的元素。

:in-range Applies to elements with range limitations where the value is within those limitations. This applies, for example, to date/time, number, and range input types with min and max attributes. When the value is null, it is :in-range.

:in-range适用于具有范围限制的元素,其值在这些限制之内。 例如,这适用于具有min和max属性的日期/时间,数字和范围输入类型。 如果该值为null,则为:in-range

:out-of-range The opposite of :in-range: elements whose value is outside the limitations of their range. Missing values are not out of range, as they are empty.

:out-of-range :in-range:的相反值,其值超出其范围的限制。 缺少的值不超出范围,因为它们为空。

:required Applies to form controls that have the :required attribute set.

:required适用于设置了:required属性的表单控件。

:optional Applies to all form controls that do not have the :required attribute.

:optional适用于所有没有:required属性的表单控件。

:read-only Applies to elements whose contents are unable to be altered by the user. This is most elements other than those with the contenteditable attribute set and form fields.

:read-only适用于其内容不能被用户更改的元素。 这是除具有contenteditable属性集和表单字段的元素以外的大多数元素。

:read-write Applies to elements whose contents are user-alterable, such as contenteditable components and writable input fields.

:read-write适用于内容可由用户更改的元素,例如, contenteditable组件和可写的输入字段。

Browser support for these attributes is complete in browsers that support the attributes in their form controls; in other words, browsers that support required and pattern also support the associated :valid and :invalid pseudo-classes.

浏览器对这些属性的支持在支持其表单控件中的属性的浏览器中完成。 换句话说,支持required和pattern的浏览器还支持关联的:valid:invalid伪类。

IE8 and earlier lack support for :checked, :enabled, :disabled, and :target. The good news is that IE9 does support these selectors, but not the user-interface selectors. IE10 and IE11 support :indeterminate, :required, and :optional, but not :default, :in-range, :out-of-range, :read-only, or :read-write.

IE8和更早的版本不支持:checked,:enabled,:disabled和:target。 好消息是IE9确实支持这些选择器,但不支持用户界面选择器。 IE10和IE11支持:indeterminate:required:optional ,但不支持:default:in-range:out-of-range:read-only:read-write

While support is still lacking, JavaScript libraries such as Selectivizr can help in targeting these pseudo-classes in Internet Explorer.

尽管仍然缺乏支持,但是Selectivizr之类JavaScript库可以帮助在Internet Explorer中定位这些伪类。

翻译自: https://www.sitepoint.com/pseudo-classes-the-basics/

iso-3166-伪2

iso-3166-伪2_伪类-基础相关推荐

  1. java官网教程(基础篇)—— 基础的Java类 —— 基础 I / O

    目录 基本 Java 类 基础 I/O I/O流 字节流 字符流 缓冲流 扫描和格式化 扫描 格式化 从命令行中进行IO操作 数据流 对象流 文件 I/O(采用 NIO.2) 什么是路径? Path类 ...

  2. JavaのFile类基础操作之问题

    在上一章节,介绍了File类的基础操作,比如文件的创建,文件的删除等等.这一章节,将介绍在File类基础操作中遇到的问题. 1.路径分割符问题 在实际的软件开发与运行过程中,往往都会在Windows环 ...

  3. 计算机视觉之OpenCV教程 --- Mat图像类基础(二)

    机器视觉之OpenCV教程图像容器Mat类基础一(二) 一.Mat像素点的存储方法 色彩空间是指我们通过组合颜色分量来对各种颜色编码 灰度图像: 从黑到白 ,逐渐过渡 , 划分成若干灰度级别 彩色图像 ...

  4. 计算机视觉之OpenCV教程 ---Mat类基础(一)

    机器视觉之OpenCV教程图像容器Mat类基础一(一) 零.OpenCV概述 基本上在机器识别的领域 ,都有OpenCV的身影 . OpenCV中基本上包含了所有的机器视觉所用到的算法 , 即使没有也 ...

  5. 国际标准组织 ISO 3166 的国家或地区代码

    国际标准组织公布的 ISO 3166 国际标准针对国家或地区进行编码,它有三部分: * ISO 3166-1 有国际标准化组织(ISO)的标准国家代码.1974 年首次出版.每个国际普遍公认的国家或地 ...

  6. 国际标准之国家编码 - ISO 3166

    ISO 3166定义了各个国家的英文名字的字母缩写,2个大写字母. 而且小写的2个字母用来表示html网页的顶级域名. ISO Country AD Andorra AE United Arab Em ...

  7. superset使用(四) 地图绘制的ISO 3166转码以及名称汉化显示

    superset使用(四) 地图绘制的ISO 3166转码以及名称汉化显示 本文以制作"中国地图"为例 在chart中选择"Country Map" 我这里提供 ...

  8. 轨迹发生器 matlab,GPS和INS组合导航程序,其中包括轨迹发生器、KALMAN滤波、模型建立、伪距伪距率组合方式进行仿真...

    中文说明: GPS和INS组合导航程序,其中包括轨迹发生器.KALMAN滤波.模型建立.伪距伪距率组合方式进行仿真,可以对程序进行任意修改,有实验报告作为示例,可以作为导航专业的毕业设计参考例程使用. ...

  9. C++类基础学习(1)

    类基础学习(C++) 题录:作者是个博客小萌新,C++已学习了一段时间,做过几个小项目(VS+qt的),但都很简单,在深入学习时,发现但个人缺少系统的总结以及整体知识框架的构建,所以准备通过CSDN这 ...

  10. #systemverilog# “类”翱翔在systemverilog的天空(1)类基础认知

    我们知道,Systemverilog 与Verilog HDL 的不同之处在于,它支持面向对象语言编程.那么,提到面向对象,自然少不了主角:class.今天总结一下 Systermverilog 中的 ...

最新文章

  1. 港中大、商汤开源目标检测工具包mmdetection,对比Detectron如何?
  2. php设置ip,使用PHPIP的IP管理
  3. react-native 小米手机和 mac 安装
  4. suse linux 查看内存,Suse linux查询内存大小的指令是什么?
  5. 图的邻接矩阵(C语言)
  6. Java-泛型-ArrayList
  7. 基础知识回顾——通用序列操作
  8. 【转载】关于网页尺寸的设置
  9. 在Markdown中更改图像大小
  10. 深入浅出MFC:动态创建控件
  11. 我的第一个游戏FoodieThebug完成之后的心得体会 -子龙山人
  12. 在虚拟机中安装centos6操作系统,DHCP下克隆,再使用CRT软件进行远程登录
  13. Java家庭收支记账程序
  14. 计算机上机考试自我检查800字,学生检讨书800字反省自己【三篇】
  15. openStack4j网络增删改查
  16. 最火的几颗国产视频芯片
  17. jquery 处理页面弹出层查询数据等待的操作(gif图片加载等待)
  18. cad线加粗怎么设置_CAD图纸线条粗细如何修改?CAD图纸线宽如何调整?
  19. 腾讯云对象存储的完整教程,java将文件上传到腾讯云上后返回可以访问的连接
  20. 如何在网站上增加Google analytics,手把手操作

热门文章

  1. Springboot快速整合通用Mapper
  2. php 美颜,图像处理美颜算法之瘦脸及放大眼睛
  3. 大学生创新创业万学答案(三)
  4. 机器学习笔记之受限玻尔兹曼机(四)推断任务——边缘概率
  5. cad批量逐个填充lisp_快速填充的多选问题 - AutoLISP/Visual LISP 编程技术 - CAD论坛 - 明经CAD社区 - Powered by Discuz!...
  6. Android ps进程命令
  7. C# String 与 Ushort[] 数组 相互转换
  8. 本地域名设置和跨域行为
  9. php 获取ip地址所在的区域
  10. JS数组遍历方式 小小总结一下