I recently created my own blog using Google's Blogger.
When I have completed reading a particular book, I have a Book's I Read Section where I would like to have a static 5 Star Rating System in place of some kind. Perhaps with CSS, I can target each book so I will be able to display from 1 to 5 Stars for the visitor to see.
I'm not sure how to edit the CSS of individual blog posts so I can target these specific read books, if that's the best method, and would like any tips in creating an image which I could specify how much of the 5 stars should be displayed (like 100% for 5 Stars, 80% for 4 Stars, 60% for 3 Stars, etc.)?
This method does NOT use JavaScript, jQuery, CSS or CSS3.
To clarify: It uses plain ASCII Code to provide the STAR requirements.
Solid Star: ★
ASCII Code for Solid Star:
★
Outline Star: ☆
ASCII Code for Outline Star:
☆
Live DEMO Follows (sorry jsFiddle!):
Book Title: A Trip To The Dentist
Book Author: Yin Pain & Lord Howard Hurts
Star Rating: ★☆☆☆☆
Book Title: Chest Pain
Book Author: I. Coffalot
Star Rating: ★★☆☆☆
Book Title: Dealing With Skunks
Book Author: Stan Back
Star Rating: ★★★☆☆
Book Title: Real Eyes Realize Real Lies
Book Author: I.C. You
Star Rating: ★★★★☆
Book Title: Spots On The Wall
Book Author: Who Flung Poo
Star Rating: ★★★★★
HTML markup for above:
★☆☆☆☆ ★★☆☆☆ ★★★☆☆ ★★★★☆ ★★★★★
Optional: Use
CSS font properties
to change star size, color, and background to customize it!Use a jQuery Star Rating Plugin.
See 2nd-half for CSS only method.
Here's a screenshot from the jQuery Star Rating Plugin. The Database Integration Tab has more plugin examples and you can always search for more jQuery Star Plugins HERE if you need that.
Screenshot:
Reference:
jsFiddle Demo for jQuery Star Rating Plugin
Screenshot of jsFiddle jQuery Star Rating Demo:
Minimal HTML markup that the jQuery Star Rating Plugin uses (extremely configurable):
Above and below are TWO very different solutions for this Answer.
Use a Pure CSS Rating System without jQuery plugin or JavaScript.
See 1st-half above for jQuery Star Rating Plugin method.
Reference image used was from hot-linkable imageshack.us and is shown below.
Dimensions are
width:98px;
andheight:143px;
and image type isjpg
.Reference:
jsFiddle Demo for Pure CSS Star Rating
Screenshot of jsFiddle Pure CSS Demo:
Minimal HTML:
Complete CSS:
You can change the CSS of a specific tag using the
style
attribute:The
.stars
class could look like this:Where
stars.png
is a 20px wide image, then repeated on the x dimension 4 times (80px) for 4 stars. 5 stars would be 100px width, etc.The general idea above is realized in this jsFiddle Demo, complete with tutorial comments.
Reference:
jsFiddle Demo featuring Repeatable Star Rating CSS Demo
Screenshot: