John Schulz's Gravatar John Schulz's Profile

About Me:

Last 10 Comments

1

Hey Chris,

How have you been? ;)

What do you think of adding class="php" to your code tags?

You could do:

<code class="php>

<span class="keyword">if</span>

</code>

or:

<span class="php keyword">if</span>

The CSS would be:

.php .keyword, /* class php with descendent keyword */

.php.keyword { /* both php AND keyword in same tag */

/* your style */

}

I used the typical code and span markup (to make sure the example got through your Friggin' Sharks With Friggin' Laser Beams form processing) but the CSS doesn't care about the tags used, only the classes applied in them.

Then when you want to post examples of crappy Ruby || Perl || JavaScript you can use different styles for them.

Perhaps you already do this but not on the comments, I'm too lazy to look.

Later,

John

Posted in /blog/2006/oct/formatting-and-highlighting-php-code-listings.

Sun, 17 Jun 2007 at 16:36:41: Link


Stats

  • Member Since: 17 Jun 2007
  • Comments: 1

Web Site

JFSIII.org/drupal/

Blog Posts

Coming soon!