Wasn't sure why this suggested edit was necessary. The only tag is so I thought this should be picked up by our algos.

Tagging as bug but it may be a feature request.


1 Answer 1


The problem with is twofold:

  1. It corresponds to the default language hint because it's often used with other tags such as and . The default hint is used to allow prettify to highlight code blocks automatically, preventing clashes between different languages in the same post.

  2. In answer to the question title: prettify does not auto-detect CSS code blocks correctly, and so never automatically highlights CSS code blocks as such. It highlights using the parsing rules set out by the default hint, which is not compatible with CSS.

Since prettify cannot reliably automatically highlight CSS snippets, we have to tell it explicitly to do so. When you see edits adding lang-css hints appropriately, feel free to approve them. Otherwise, sadly, this can't be easily remedied because of point 1.

We could change it so that corresponds to lang-css, but that would break questions containing snippets in other languages such as and which also use default hints, for the reason stated in point 1.

This issue is further explored here: What's happening to syntax highlighting for [css] questions?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .