A *:body pseudo class

This might well have been thought of already. But when 
designing/styling some HTML documents as a book, I found myself 
repeatedly adding div elements of the following kind:

<section>
 <h1> Headding</h1>
 <div class="body-text">
   <p>Lorem
   <p>Ipsum
   <p>Dolor
   <p>Sint
 </div>
</section>

The point was to be able to style the body independently from the 
heading. For instance, I wanted a border around the body. And I wanted 
the body - but not the heading - to be split in columns. Etc.

Given that it ought to be a universal pattern that body text follows 
*after* headings, I am hereby proposing a *:body pseudo class. 

The :body pseudo class should select all non-heading content inside a 
particular element. And its purpose should be to avoid that authors 
have use div elements in order to make such sections selectable and 
stylable.

(I say ”and stylable” because pseudo classes are (in)famous for not 
allows as much styling as ”real” HTML classes. Think :link and 
:first-line, for instance.)
-- 
leif halvard silli

Received on Friday, 31 January 2014 05:36:04 UTC