---
title: Opera 21 released
authors:
- mathias-bynens
intro: '[Opera 21 for Mac and Windows](http://www.opera.com/computer) (based on Chromium 34) is out! Here’s what that means for web developers.'
tags:
- css
- javascript
- opera-21
license: cc-by-3.0
layout: post
---

[Opera 21 for Mac and Windows](http://www.opera.com/computer) (based on Chromium 34) is out! Here’s what that means for web developers.

## `<img srcset>`

[The `srcset` attribute](http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html#attr-img-srcset), to be used on its own or [in conjunction with the upcoming `<picture>` element](http://picture.responsiveimages.org/#element-attrdef-srcset) is now implemented. For now, only its `x` syntax, which causes a different resource to be loaded and rendered based on the pixel density of the device, is supported. Here’s a simple example:

    <img alt="A unicorn gazes into a magical enchanted mirror." src="unicorn@1x.jpg" srcset="unicorn@2x.jpg 2x, unicorn@3x.jpg 3x">

Until `srcset` is fully supported in all browsers, you may want to use [Picturefill](http://scottjehl.github.io/picturefill/) which acts as a polyfill for `srcset` (and `<picture>`, too!).

## Unprefixed `Element.prototype.matches()`

Opera previously supported the `Element.prototype.webkitMatchesSelector()` method. We now support the standardized and unprefixed name for it, i.e. [`Element.prototype.matches()`](http://www.w3.org/TR/selectors-api2/#matches).

    var element = document.querySelector('.foo .bar');
    element.matches('input');
    // → `true` if `element` is an `input` element, else `false`

## Controlling ligatures in text through CSS

Opera now supports [the `font-variant-ligatures` CSS property](http://dev.w3.org/csswg/css-fonts-3/#font-variant-ligatures-prop), which makes it possible to define what kinds of ligatures and contextual forms to use when rendering text. Looking for a demo? Check out [Eric Meyer’s test case](http://meyerweb.com/eric/css/tests/css3/show.php?p=font-variant-ligatures).

If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following [our Opera Developer stream](http://www.opera.com/developer).

Add blog post about the Opera 21 release
Add blog post about the Opera 21 release
