prince-tooltip: transparent | none | normal | flow( name, page-policy? ) | [ "string" | url( filename ) | counter( name, counter-style?, page-policy? ) | counters( name, "separator", counter-style?, page-policy? ) | target-counter( url, counter, counter-style? ) | target-counters( url, counter, "separator", counter-style? ) | target-content( url ) | leader( "..." | dotted | solid | space ) | string( ident, page-policy? ) | content( ) | prince-base-url( ) | prince-script( ident, content? ) | element( name ) ]+
Initial value |
transparent
|
---|---|
Applies to | all elements |
Inherited | no |
{
*[title] { prince-tooltip: attr(title)
}
The prince-tooltip
property can be used to create a tooltip when
hovering an element in the PDF file. The keyword none
actually
"suppresses" tooltips, which means that it will not show any tooltip for
objects underneath the selected element, that might have a tooltip. An empty
string, or some content that evaluates to an empty string, is treated
equivalent to none
, rather than showing an empty tooltip.
The most simple use is to insert a literal string. A literal string can also
be passed as an argument to the leader()
function, which expands
to fill the available space on the line like justified text, by repeating the
string as many times as necessary. It can also be referenced with the
string()
function, in which case it needs to be defined in the
string-set
property (see Copying
text content from the document).
The second argument to the string()
function is a
page-policy
, which can be one of the following: first
(the first value the string is set to on the page), first-except
(equivalent to start
unless the
string-set
is applied on the current page, in which case it will return no value),
last
(the last value the string is set to on the page) or
start
(the value the string has at the start of the page).
These page policy values are only meaningful for string()
used
in page page region content.
It can also be used to insert external content fetched from another resource:
this can be done with the url()
function, the target-content()
function (see Using target-content)
or the prince-base-url()
function. It can also be done
with the prince-fallback()
function, which works just like the
url()
function, but also has the possibility of specifying a fallback
content
, in case the loading of the URL should fail.
The content to be inserted into the tooltip can also be fetched from other
elements, or their attributes, with the element()
and the
attr()
functions, or with the content()
function.
Also, any block-level element can be removed from the normal flow with the
prince-flow
property and can be inserted with the flow()
function. See also the
documentation for Taking
elements from the document for more details.
The prince-tooltip
property can also be used for different forms
of counters with the counter()
and counters()
,
target-counter()
(see
Using target-counter)
and target-counters()
functions.
Last but not least, Prince supports arbitrary JavaScript functions to be called
from CSS generated content using the prince-script()
function (see
Script Functions).
A special function is prince-glyph-index
, which allows to choose
a glyph from a font by the index of that glyph in the font. Note that this is
very non-portable, as glyph indices are specific to individual font versions.
But it is a possible escape hatch for people who need a specific glyph and don't
have any other way of accessing it (by Unicode character or OpenType substitution).
In most features, the prince-tooltip
property functions in much
the same way as the content
property - it is used in the same manner to insert content.
Please note that tooltips are not a standard PDF feature, and they may only work in Adobe Reader and Adobe Acrobat and may not be visible in other PDF viewers, such as web browsers.