You're repeating a lot of CSS. Let's fix that by using your #strength ID.
<style type="text/css">
#strength {
width: 200px;
text-align: center;
font-weight: bold;
}
.strength0 {
background-color: #B20E37;
}
.strength1 {
background-color: #D32847;
}
.strength2 {
background-color: #ff5f5f;
}
.strength3 {
background-color: #83D680;
}
.strength4 {
background-color: #4dcd00;
}
.strength5 {
background-color: #399800;
}
.errorclass {
font-size: 10px;
font-family: Arial;
font-weight: bold;
color: #4F080B;
}
</style>
Notes:
- Please check your rule for
.errorclassagain. Yourfont-familydeclaration ends with a,instead of a;. - In my opinion, one should always leave a space between
:and value undand property declarations. It simply improves readability. - Be aware when using the shorthand of a property. An example of what could happen: If you write
background: red;, this doesn't only set thebackground-colorto red. It also applys the default values for the other properties available in the shorthand syntax (background-image,background-repeat, ...)