Having a long title like this
However, since some titles are actually brief enough the "short" attribute is optional and doesn't go with every <h1> element.
My CSS at the moment is this:
Is there a way to select an attribute if it exists, and if not, the element's content? Or will I have to provide "short" for every <h1> element?
<h1 short="Brief title">This is a very long title for this section</h1>
it would occupy two lines in the header of the left pages. That looks kind of ugly, so I added a "short" version of the title as an attribute.However, since some titles are actually brief enough the "short" attribute is optional and doesn't go with every <h1> element.
My CSS at the moment is this:
h1 {
font-size: 18pt;
text-align: center;
string-set: chaptertitle content(); /* attr(short); */
}
Was I to use the attr() here then, it seems, it would have to become a required attribute.Is there a way to select an attribute if it exists, and if not, the element's content? Or will I have to provide "short" for every <h1> element?