The latest CSS technology learned today

Source: Internet
Author: User
Background: Image-set ()

The image-set in the css4-images specification can achieve Retina screen display, mainly used to solve the design challenges of Apple Retina screen.

    • In a browser that does not support image-set, it supports background-image images, that is, it does not support image-set browsers, and they parse background images in background-image;
    • Supports image-set: If your browser supports image-sete and is on a normal display screen, the browser selects @ 1x background image in image-set;
    • Image-set on the Retina screen: If your browser supports image-set and is on the Retina screen, the browser selects @ 2x background image in image-set.

Note: currently, image-set can only run under "Safari6" and "Chrome21" using the private attribute "-webkit" of the webkit browser. IOS 6 is also supported. However, it is a pity that other browsers still do not support image-set. Currently, it is only a draft of CSS4 and should be noted when using it.

Related Articles:

Image-set for Retina screen display

W3C specifications

The Webket project recently added support for CSS Level 4 image-set specifications.

 

Background: element ()

-Moz-element (): For background-image extensions, any other element can be used as the background of the current element. The usage is as follows:

<Div style = "width: 400px; Height: 100px; Background:-moz-element (# mybackground2);"> some text </div> <Div style = "overflow: hidden; Height: 0; "> <button id =" mybackground2 "type =" button "> edevil button! </Button> </div>

Effect:

Note: Currently, this CSS attribute is only supported by firefox4 + and is not supported by other browsers. Please use it with caution!

Related Articles:

Firefox 4 Beta 9 developer features

MDN Problems

Example

W3C specifications

 

Background: canvas ()

Use the generated canvas as the background of the element. Usage:

Effect:

Related Articles:

Example

CSS canvas drawing

Canvas-driven background images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.