Very nice CSS star effect summary 1th/2 page _ Experience Exchange

Source: Internet
Author: User
With pure CSS to create star rating effect is increasingly used in the network Ria, combined with Ajax technology, can render a very good visual effects and great user experience, before this article began, we can first go to Cssheaven feel.

Recently because of the project needs, I found a lot of CSS star rating on the internet examples and instructions, but found that most of the articles are translated abroad, and explain is not very clear, so I decided to do a summary of their own, but also hope to give you some help.

First of all, write in Chinese the algorithm of this effect:
1. Use the location of the background image switch to get the star effect;



2. The whole effect of the most critical place is "three-layer theory", the entire effect is divided into three layers--empty layer, fractional layer and scoring layer, three-storey layout is absolute, to avoid the UL itself with the relative layout (of course, with DIV can also achieve the same effect);
3. Empty layering is to use the background image of "empty Star" as the background, and tile horizontally;
4. The width of the fractional layer is equal to the value obtained by the (score * picture width) and is tiled horizontally using the "fractional Star (yellow in example)" in the background image;
5. Playing a hierarchy is to place 5 empty links in the 5-star position (width to match the background picture) and set the 5 a:hover background to "Point Star (here is green)", with a width of stars * Picture width, left 0 This combines a:hover different widths to show the scoring effect, and the vertical coordinates are less than the vertical coordinates of a (to ensure that the current a:hover does not block other links);
Current 1/2 page 12 Next read the full text
Related Article

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.