inheritance from nonancestor

It would help if we could inherit nonancestral style. This would improve consistency across browsers. To that end, we apparently need an addition to the CSS specs. Test case: For the sake of a search engine, only one h1 element should appear on a page, but I want a subtitle with a slightly smaller font-size. So writing two h1 elements, even with different classes or id values, is out. And writing the subtitle as h2 immediately after the h1 is also out. Both are forbidden by HTML5, section 4.12.1. But if I write and style a p element then I have to predict the particulars of how various browsers will style h1 in order to have the p element have the same look as the h1 gets except for differences I specify (probably just the fontsize). Instead, I created a hack (as in <h1>Main Title<br /><span>Subtitle</span></h1> (see but haven't tested it much (but see in case of possible responses) and wonder if, even with enough testing, a more semantic way wouldn't be better.


Received on Friday, 4 March 2016 14:26:31 UTC