IT. Expert System.

CSS

attr()


Description

The attr() function returns the value of the specified attribute.

This function has the form:

attr(attribute [',' <type> [ ',' <value> ]])

In CSS 2.1, the attr function only returns a string and can only be used with the content CSS property.

In CSS 3, functionality was expanded but is still very limited and varies widely between browsers. For example, IE8 and later can only take one argument.

Arguments

Name Description
attribute Specifies the attribute name. An optional namespace can be specifed separated by '|'
type

(optional) Specifies how to interpret the attribute. Valid values include:

string
(default) Interpret as a CSS string

color
interpret as a CSS color value

url
interpret as the URI part of a 'url()' expression

integer
interpret as a CSS integer. default = 0

number
interpret as a CSS number. default = 0.0

length
interpret as a CSS length. default = 0

angle
interpret as a CSS angle. default = 0

time
interpret as a CSS time. default = 0

frequency
interpret as a CSS frequency. default = 0

em
ex
px
mm
cm
in
pt
pc
deg
grad
rad
ms
s
Hz
kHz
interpret as a floating point value with the type suffixed as the unit. default = 0 with the relavant unit

value (optional) Specifies a valid CSS value

Examples

This example shows how to set a width based upon a length:

width: attr(length);

Browser Support

Chrome Firefox IE Safari Opera

Miscellaneous Information

Defined In: CSS2.1


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: 370 / 158764034. Delta: 0.02704 с