IT. Expert System.

CSS

Attribute Selector


Description

The attribute selector matches elements that have a particular value for a particular attribute.

Attribute selectors are delimited by square brackets.

This selector has the following three forms:

E[attribute] {
  properties
}

This form matches all E elements that have an attribute named attribute.

E[attribute="value"] {
  properties
}

This form matches all E elements that have an attribute named attribute with a value of value.

E[attribute~="value"] {
  properties
}

This form matches all E elements that have an attribute named attribute with a space-separated list of values, one of which is value.

This form can also be used to match elements with a specific class by specifying class as the attribute.

Note: For the last form, "|=" can be used instead of "~=" to match a hyphen-separated list of values.

Examples

This example colors the text red for every h1 element that has intro as the class.

h1[class~="intro"] {
  color:red;
}

This selector would match both:
<h1 class="intro"> and
<h1 class="example intro">, but not
<h1 class="introduction">.

Browser Support

Chrome Firefox IE Safari Opera

Miscellaneous Information

Defined In: CSS2


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 180 / 158765850. Delta: 0.02458 с