Conditionalize an attribute set
Set up an attribute set so that it formats an element one way in one context and a different way in another context.
Before you start
Complete the exercise Call a new attribute set.
In some cases, you might need to create a new attribute set for use only under
certain conditions. For example, you might want text in a
<p> that follows a
<ul> to be
formatted differently from other instances of
<p>. This is
conditionalizing based on context. In other cases, the context might not be
predictable. When that is the case, you might want to use the outputclass
attribute to call for alternate formatting.
For this example, let’s use your new attribute set, b_red. After the previous exercise, all instances of ...