Strict HTML strips CSS classes in a custom block
Default custom blocks in Drupal 8 use the Basic HTML text format. Using either Basic HTML or Restricted HTML will remove any class attributes. 

You need to set your format to Full HTML to prevent Drupal from stripping out these attributes.