mirror of
https://github.com/susam/spcss.git
synced 2025-09-03 02:42:40 +02:00
Use unitless line-height for heading elements
Prior to this fix, the line-height of heading elements is set to 1.2em. This leads to an issue when the font-size of heading anchor element is reduced as shown in the following example: <!DOCTYPE html> <html lang="en"> <head> <title>Test</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, intial-scale=1"> <link rel="stylesheet" href="sp.css"> <style> h2 {background: lightblue} div {background: orange; display: inline-block} p {background: lightgreen} .b a:empty {font-size: small} </style> </head> <body> <div class="a"><h2>Foo<a href="#"></a></h2><p>Bar</p></div> <div class="b"><h2>Foo<a href="#"></a></h2><p>Bar</p></div> </body> </html> The smaller font-size for the anchor element within class "b" leads to a larger overall size for the heading element as explained at <https://stackoverflow.com/a/21575694>. Set the line-height of heading elements to the unitless number 1.2 to resolve this issue.
This commit is contained in: