Pseudo-class styles for backgrounds, Sprite, hyperlinks in CSS

Source: Internet
Author: User

I. BACKGROUND 1. Background color background-color:red;2. Background picture Background-image:url (".. /..  /img/l1.png "); 3. Picture fill background-repeat:no-repeat; (with these three commonly used attribute values: No-repeat, Repeat-x, Repeat-y) 4. Background image size    background-size:100% 100%; cover (overlay): (First let the picture fill the container horizontally) the picture is scaled, until the smallest part fills the container there may be an effect that the picture does not appear completely.    Contain (included): (Let the picture fill the container vertically) the picture is also scaled until the largest portion fills the container and the image overlay may appear incomplete. 100% 100%: Make the picture horizontal and vertical just fill the container causing the picture to be stretched or compressed.    5. Background image position Background-position:bottom right;    When you specify only one direction in x or Y, the other direction defaults to the center effect, and it can also have a value of 6. The starting position of the background picture is background-origin:padding-box; Border-box: Starting from the outside frame show Padding-box: Starting from the inner margin Content-box: Start */7 from the content. Background picture clipping position background-clip:content-box;8. Composite properties for background back Ground:red URL (".. /..    /img/j.png ") no-repeat 20px 20px; It combines these four properties Background-color, Background-image, Background-repeat, background-position Two, sprite Figure 1. Entry explanation   CSS Sprite, Some people call it CSS Wizard, is a kind of CSS image merging technology, the method is to combine small icons and background images on a picture, and then use the background of the CSS to display the image to display the part. 2. The rationale for CSS Sprite is to integrate some of the images you use on your site into a single image, reducing the number of HTTP requests on your site. This image is rendered using CSS background and background-position properties, which means your tags are more complex, and the images are defined in CSS rather than tags. 3. code example <! DOCTYPE html>

Background, Sprite, hyperlink pseudo-class style in CSS

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.