html - styling each line inside pre with css -
i have html code
<pre> line 1 line 2 line 3 </pre>
how can put css style "lines" inside <pre>
, without adding other wrapper it?
what mean like
pre lines{ color: red}
i'm having difficulties on finding css selector that. in advance.
you can use little css3 trick, gradients. create automatically, without spans, "zebra" effect:
background: #555; background-image: -webkit-linear-gradient(#555 50%, #505050 50%); background-image: -moz-linear-gradient(#555 50%, #505050 50%); background-image: -ms-linear-gradient(#555 50%, #505050 50%); background-image: -o-linear-gradient(#555 50%, #505050 50%); background-image: linear-gradient(#555 50%, #505050 50%); background-position: 0 0; background-repeat: repeat; background-size: 4.5em 4.5em;
try different css "line-height" text appears correctly.
see: http://www.dte.web.id/2012/03/css-only-zebra-striped-pre-tag.html#.uuov6lugkom
Comments
Post a Comment