Fun with line-height

Funsville

When you know the line-height, you can make a linear-grdient that has hard color stops in between each line of text. Gaperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio.

Emphasize Start

It's easiest when the background starts on top of the text like in this case, consectetur adipisicing elit. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio

Fade Out Bottom

But we can also make it work for the bottom of text (depite its length) by using calc() in the gradients, substracting it from the elements full height. Sit amet, consectetur adipisicing elit. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio

Lines

There are plenty of little things that can screw this up, but if you're careful, you can create a 1px gradient that repeats at the current line-height so that it's between lines of text no matter what. I first saw Lea Verou do this. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio.

Ticks

You can set the background-size of an image to match the line-height, so that it's always the same size of a line. Perferendis Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio. Corrupti cupiditate, aperiam nemo saepe sunt enim, perferendis aut numquam est doloremque tempora molestias in vero? Eius animi odit earum, fugit optio