Baseline detection
✓ Published0🌍 Public
Aabernier
Last edited Jan 27, 2018
Created on Jul 21, 2012
This example demonstrates how to detect the typographic baseline of a web page’s body text. It shows the baseline as a horizontal reference line, calculated from the relative vertical positions of two “A” characters—one rendered at font-size zero and one at 999px. The code uses jQuery to measure element positions and CoffeeScript to define a custom `baseline` method on jQuery objects. The detection is performed by temporarily appending hidden spans to the page, then removing them after measurement.
AI-generated description