Home Forums DITA and XMetaL Discussion CSS challenge Reply To: CSS challenge

Su-Laine Yeo

Reply to: CSS challenge

Another CSS option: OK, this is hacky, but it should work for one or two elements preceding the first title, and you can extend it to account for as many elements as you're likely to have.

/*Assume section titles are misplaced*/
section>title:before {
    content: “[Misplaced title] “;
    color:red;
    font-weight: bold;
}

/*Title which is the first element in a section*/
section>title:first-child:before
{
content: “”;
color: Black;
}
/*Title which is the second element in a section, after an indexterm*/

section>indexterm:first-child + title:before
{
content: “”;
color: Black;
}

/*Title which is the second element in a section, after two indexterms*/

section>indexterm:first-child + indexterm + title:before
{
content: “”;
color: Black;
}

Reply

Products
Downloads
Support