The spec says that the fenced code block info string is used to populate the class attribute of the <pre> tag.
An info string can be provided after the opening code fence. Opening and closing spaces will be stripped, and the first word is used here to populate the class attribute of the enclosing pre tag.
However, this is dangerous. Consider the following CSS and Markdown:
“Don’t do that then.” This is a job for a user-submitted-content sanitizer, not for Markdown proper. (In other words: if I’m the sole author of a document I ought to be able to set my CSS classes to whatever I damn well please.)
There could be an unintentional name collision with existing classes on a page however. For example, reddit.com uses .title for various elements. If ```title results in <div class="title">, then that causes an issue.
That seems like a good idea, however I think that’s some kind of implementation detail that should be left to the implementation. I could imagine having a preference of some kind for “code class prefix” or something like that.