Hope you don’t mind if I take a shot at this.
Using the example you provided, the width of the <td> element is the only property that is different between a 5 point question and a 10 point question.
Door number 1 …
Ralph’s suggestion is easy to implement and uses what you have already done to your advantage. I think he directly address what you are trying to do. He says to code the common properties for both Likerts, which you have already done; and then to assign the differentiators to separate classes, as in the following example:
/* LIKERT Question */
#rateThisArticle .radioLikert {
padding: 0;
border: none;
}
#rateThisArticle .radioLikert table {
margin: 0 0 0 25px;
}
#rateThisArticle .radioLikert td { /* notice that the width property has been deleted */
vertical-align: top;
border: none;
}
#rateThisArticle .radioLikert td label {
display: block;
margin: 0;
padding: 0;
font-size: 0.9em;
line-height: 1.4em;
font-weight: bold;
}
#rateThisArticle .radioLikert td label span {
display: block;
margin: 0;
padding: 0;
font-size: 0.9em;
line-height: 1.4em;
}
#rateThisArticle .five td { /* the width for a 5 point question is added via this class */
width: 60px;
}
#rateThisArticle .ten td { /* the width for a 10 point question is added via this class */
width: 50px;
}
That method requires three classes, and there will ALWAYS be two classes used for each question in the markup, as shown in Ralph’s example. Think of them as the primary class with the common descriptors for both groups (.radioLikert) and the secondary classes with unique properties that describe a five or ten question group (.five and .ten). Efficient.
The HTML would contain class=“radioLikert five” or class=“radioLikert ten”
Door number 2 …
This is another method of accomplishing the same thing. The css isn’t as clean looking but the html only requires one class. Assign 2 unique selectors to all common property groups. Then apply unique properties to differentiate the individual selectors. (I think this is the method you didn’t care for.)
/* LIKERT Question */
#rateThisArticle .radioLikert5,
#rateThisArticle .radioLikert10 {
padding: 0;
border: none;
}
#rateThisArticle .radioLikert5 table,
#rateThisArticle .radioLikert10 table {
margin: 0 0 0 25px;
}
#rateThisArticle .radioLikert5 td,
#rateThisArticle .radioLikert10 td { /* notice that the width property has been deleted */
vertical-align: top;
border: none;
}
#rateThisArticle .radioLikert5 td label,
#rateThisArticle .radioLikert10 td label {
display: block;
margin: 0;
padding: 0;
font-size: 0.9em;
line-height: 1.4em;
font-weight: bold;
}
#rateThisArticle .radioLikert5 td label span,
#rateThisArticle .radioLikert10 td label span {
display: block;
margin: 0;
padding: 0;
font-size: 0.9em;
line-height: 1.4em;
}
#rateThisArticle .radioLikert5 td { /* the width for the 5 point question is added here */
width: 60px;
}
#rateThisArticle .radioLikert10 td { /* the width for the 10 point question is added here */
width: 50px;
}
The HTML will contain class=“radioLikert5” or class=“radioLikert10”
I don’t know what fieldsets are, but I think that’s where these classes would be applied in your code.
Food for thought intended to help connect the dots.