laziness, impatience, and hubris | |
PerlMonks |
Re: Stupid Code Block Trick Re: We Stylin'!by mdillon (Priest) |
on Feb 14, 2002 at 03:02 UTC ( [id://145351]=note: print w/replies, xml ) | Need Help?? |
Here's what I've got (keep in mind that I use the Dark Theme):
This way, my CSS won't make just any <pre> look like code, only <pre><tt>. I don't want to see every use of preformatted whitespace as code. Since I am selecting <tt> (an inline element) inside of <pre>, the styles apply to the <tt>; hence, the "display: block;" part. This code still suffers from the problem of mis-styling a <tt> used inside <pre> in cases like: <pre>blah blah blah, <tt>Typewriter</tt> <strong>power</strong></pre> (I know, It's contrived). However, this is because CSS can't select (or disallow) so-called "anonymous" elements (i.e. text chunks). Or, you can just do it your way, which is fine. Update: since I was having problems with the Everything Engine messing with my square and pointy brackets, I moved my CSS into an external file. I have updated the code block to reflect my latest CSS.
In Section
Perl Monks Discussion
|
|