automated change in panel color based on user rating

I am working on a website in which users can complaint about a problem, and accordingly others suggest, reply etc. What i want is that each user suggestion based on its rating should have different color panel like if rating is 3 then blue , if it is 4 then somewhat darker, and so on..can anyone suggest a way..? considering i am new to html and webdesign.

User ratings

1-3 => BLUE
4-6 => DARK BLUE
7-10 => NAVY BLUE

which language can meet the above requirements.?

Answers


I suggest to use CSS for this. Specify a classname for each of those values. E.g.

.rating-1, .rating-2, .rating-3 {
    background: blue;
}

.rating-4, .rating-5, .rating-6 {
    background: darkblue;
}

.rating-7, .rating-8, .rating-9, .rating-10 {
    background: navy;
}

Then let JSP dynamically generate the desired CSS classname on the HTML element of interest. E.g.

<div class="rating-${rating.score}">${rating.score}</div>
See also:

Need Your Help

Comparing 2 lists and appending the differences into a 3rd

python list compare

I have an issue and I can't for the life of me get anything to return past ()

Intercept return-key when on a multiline TextBox, preventing close of the dialog

.net winforms events

I have a .net WinForm dialog, which displays some TextBoxes (some of them are Multiline), a button marked as AcceptButton and one marked as CancelButton.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.