With the calendars looking much more like calendars, much easier to recognize and read at a glance than before, let’s turn to adding a little more useful visual information to them by highlighting the current week and day. In order to do this, we must first differentiate these within the HTML:
<tr class="thisweek"> <td>22</td> <td>23</td> <td>24</td> <td>25</td> <td>26</td> <td class="today">27</td> <td>28</td> </tr>
These could just as easily be
ids rather than
classes in this case, but it is possible to imagine a case where we would want to highlight different days and weeks on different calendars along a page. My general rule is to use an
id only when I have a particular reason to want only one of something on the page, usually for the sake of prominence. Elsewhere, a
class is generally more appropriate.