CSS Pseudo-Element "inner(n)"
Posted: Thu Jun 18, 2015 10:09 am
Hi,
on the users meetup George said you will (probably) add the pseudo-element "outer" in the next release. Now I'd like to get apseudo-element "inner" as well.
Use-case 1
Consider this xml
To display this as a table with css is no problem. But to show a table header, currently I have to add more elements to the xml before the first entry. For instance
With a combination of before and inner I should be able to do this purely from css with something like this:
Use-case 2
display this compact xml as table:
with this css:
Regards,
Patrik
on the users meetup George said you will (probably) add the pseudo-element "outer" in the next release. Now I'd like to get apseudo-element "inner" as well.
Use-case 1
Consider this xml
Code: Select all
<List>
<Entry>
<Name>1st Parameter</Name>
<Value>1111</Value>
</Entry>
<Entry>
<Name>2nd Parameter</Name>
<Value>2222</Value>
</Entry>
</List>
Code: Select all
<Header>
<Name/>
<Value/>
</Header>
Code: Select all
List > Entry:first-child:before {
display: table-row;
}
List > Entry:first-child:before:inner {
display: table-cell;
content: "Name";
}
List > Entry:first-child:before:inner:after {
display: table-cell;
content: "Value";
}
display this compact xml as table:
Code: Select all
<List>
<Entry Name="1st Parameter">1111</Entry>
<Entry Name="2st Parameter">2222</Entry>
</List>
Code: Select all
List {
display: table;
}
List > Entry {
display: table-row;
}
List > Entry:inner {
display: table-cell;
}
List > Entry:inner:before {
display: table-cell;
content: attr(Name);
}
Patrik