Skip to content

24 ways to impress your friends

Vote down?

Adam Clark

1. A new height unit based on the number of lines of content.

Example:
element { min-height: 2lines; }

2. Define a section of a larger image and repeat this in the background.

Example: Image size is 200×200 pixel but I want to repeat just a 20×50 pixel (top left) section of it.
element { background-repeat: repeat(0,0,20px,50px); }

literally meaning…repeat(x-coordinate, y-coordinate, width, height)