Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

During my short tenure under the CSS tag, I've noticed that code-prettify seems to interpet a naked # character as the beginning of a comment, for example:

#footer a.footA {
    color: #6bc2ef;

The first two lines would be greyed out after their '#' characters, which do not commence comments, but prefix an element ID and a color value, respectively. Is this something totally out of SO's control? Are there really more than a couple of languages that use # for comments?

See Unable to style an anchor tag? Someone explain why? for ample examples.

On a side note, why doesn't meta seem to code-prettify?

share|improve this question
up vote 4 down vote accepted

This is because the default highlighting for those tags is to auto-detect the language (presumably since posts in "webby" tags tend to contain code samples in several languages), and it doesn't always get it right. You can fix this by adding an explicit language annotation before the code block.

<!-- language: lang-css -->

    .footA:hover {
        color: #6bc2ef; !important

This will cause the correct highlighting to be used which means both no graying out, and as a bonus you get highlighted keywords as well.

share|improve this answer

You must log in to answer this question.

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