Dynamic Styles on text

Hi Jeremy,

the Dynamik Styles function works fine on boxes or graphics, but it is obviously not designed to work on text. I can make word or phrase to become an external link, but I cannot apply a dynamic style on it. Is there a reason for that?

Thank you, Ernst

Hi Ernst,

Do you mean that you’d like to apply a hover (or focus etc.) style to text that doesn’t have a link?

There isn’t any reason we couldn’t add that to Xway, and I’ll log it as a suggestion for a future update.

In the meantime, you could do this by adding a class attribute to the text along with some CSS markup in the Page Inspector. E.g.

  1. Type “Hello world”
  2. Select “world” and colour it red
  3. Add an extended attribute in the Extended Attributes section of the Span Inspector, and set the name to (e.g.) class and the value to hovertext.
  4. Add the following to the CSS Markup section of the Page Inspector:
    .hovertext:hover { color:green }

If you preview in a browser, you should see that “world” is coloured green when you move the mouse over it.

Hi Jeremy , great, it works. I actually meant to apply a hover on a word that does have a link - like “You can find it here”, and “here” would have the link. But your method works as well if the word is linked - perfect.

Thank you, Ernst

If the text does have a link, you could do this using a link style, and that wouldn’t require a class attribute or extra CSS markup. Xway lets you set link styles for a box, or page (or master page), or document.

See Styling Links in the Xway User Guide (currently on page 126) for more information.

[I notice there is a typo in that section: “You can use the Default Styles section of the Box Inspector to define default link styles for each page in a document” should be: "You can use the Default Styles section of the Document Inspector to define default link styles for each page in a document. I’ll fix this in the next update.]

Thank you Jeremy, I got it, works fine.

Best, Ernst