How do I include a class in a link inserted in an entitiy's link area?
You can add the html attributes using the attributes key which accepts an array of attributes, and add classes using the class key, which also accepts an array of classes.

/**
 * Implements hook_entity_view_alter().
 */
function mymodule_entity_view_alter(&amp;$build) {
  // Set up ctools etc. to use modal omitted for brevity.
  $build['links']['popup']['#links']['mylink'] = array(
    'title' =&gt; 'show popup',
    'href' =&gt; 'mymodule/nojs/modals',
    'html' =&gt; TRUE,
    'attributes' =&gt; array(
      'class' =&gt; array(
        'ctools-use-modal', 
        'ctools-modal-mymodule-style',
      ),
    ),
  );
}


More information about available keys, refer to theme_links() function in Drupal API.