sizes

slinky.web.html.sizes$
object sizes extends Attr

img - A list of one or more strings separated by commas indicating a set of source sizes. Each source size consists of:

  • a media condition. This must be omitted for the last item.
  • a source size value.

Source size values specify the intended display size of the image. User agents use the current source size to select one of the sources supplied by the srcset attribute, when those sources are described using width ('w') descriptors. The selected source size affects the intrinsic size of the image (the image’s display size if no CSS styling is applied). If the srcset attribute is absent, or contains no values with a width (w) descriptor, then the sizes attribute has no effect. source - Is a list of source sizes that describes the final rendered width of the image represented by the source. Each source size consists of a comma-separated list of media condition-length pairs. This information is used by the browser to determine, before laying the page out, which image defined in srcset to use.
The sizes attribute has an effect only when the <source> element is the direct child of a <picture> element. link - This attribute defines the sizes of the icons for visual media contained in the resource. It must be present only if the rel contains the icon link types value. It may have the following values:

  • any, meaning that the icon can be scaled to any size as it is in a vectorial format, like image/svg+xml.
  • a white-space separated list of sizes, each in the format <width in pixels>x<height in pixels> or <width in pixels>X<height in pixels>. Each of these sizes must be contained in the resource.

Usage note:

  • Most icon format are only able to store one single icon; therefore most of the time the sizes contains only one entry. MS's ICO format does, as well as Apple's ICNS. ICO being more ubiquitous, you should use it.
  • Apple's iOS does not support this attribute, hence Apple's iPhone and iPad use special, non-standard link types values to define icon to be used as Web Clip or start-up placeholder: apple-touch-icon and apple-touch-startup-icon.

Attributes

Graph
Supertypes
trait Attr
class Object
trait Matchable
class Any
Self type
sizes.type

Members list

Concise view

Type members

Classlikes

object tag extends TagElement

Attributes

Graph
Supertypes
class TagElement
class Object
trait Matchable
class Any
Self type
tag.type

Types

type attrType = _sizes_attr.type

Inherited types

type supports[T <: Tag] = AttrPair[attrType] => AttrPair[tagType]

Attributes

Inherited from:
Attr

Value members

Concrete methods

def :=(v: String): AttrPair[_sizes_attr.type]
def :=(v: Option[String]): OptionalAttrPair[_sizes_attr.type]