If the content of your `<pre>` is stored in a separate tiddler or field, you can force the creation of child `<div>` elements, so that `nth-child(even)` can be applied successfully.
Give this a try:
```
\define nthchild(txt,bg:"lightgray")
\whitespace trim
<style> .myClass div:nth-child(even) { background:$bg$; } </style>
<pre class="myClass">
<$list filter="[<__txt__>splitregexp[\n]]" variable="line">
<div><$text text=<<line>>/></div>
</$list>
</pre>
\end
<$macrocall $name="nthchild" txt={{test}} bg="powderblue"/>
```
where the text content is stored in a tiddler named "test".
-e