Second argument of string function (first | start | last)
The specification : string( <custom-ident> [ , [ first | start | last | first-except] ]? )
The second argument of the string()
function doesn’t work. The second argument is one of the following keywords that indicates which value of the named string should be used: first | start | last | first-except
first-except
actually works, but for now is the default argument. W3C specifications indicate that first
is the default value.
The following graphic explains and resumes how the other keywords works:
————
First
first: The value of the first assignment on the page is used. If there is no assignment on the page, the entry value is used. first is the default value.
CSS Generated Content for Paged Media Module, W3C Working Draft, 13 May 2014
Html file: first.html
Result: first-wrong.pdf
The result we should get: first-correct.pdf
————
Start
start: If the element is the first element on the page, the value of the first assignment is used. Otherwise the entry value is used. The entry value may be empty if the element hasn’t yet appeared.
CSS Generated Content for Paged Media Module, W3C Working Draft, 13 May 2014
Html file: start.html
Result: start-wrong.pdf
The result we should get: start-correct.pdf
————
Last
last: The exit value of the named string is used.
CSS Generated Content for Paged Media Module, W3C Working Draft, 13 May 2014
Html file: last.html
Result: last-wrong.pdf
The result we should get: last-correct.pdf