In most software interactive elements typically show a visual change in state when they can be interacted with.
For example, when a button is clickable, the color of the button changes when the mouse is over the button. When text is clickable, the text has an underline underneath it or it shows an underline underneath it when the mouse is over it.
These type of interactions are sometimes called hover effects or pseudo states.
We can add our own pseudo states to our artboard or entire document including all artboards.
Another way to put it is that hover effects are the styles that are applied when the mouse is moved over an element.
There are currently three methods to define hover effects.
Method 1 Define a hover effect in the page stylesheet using an id, class or type selector rule.
Method 2 Define a style declaration in a code block.
Method 3 Use a second element as a "hover element" and all it's styles to be applied on hover
After defining a style declaration you may need to have any elements reference it.
Method 1 - Defining a hover effect for an element using stylesheet template
Open the Element Options panel or dialog and select the artboard.
Click on the stylesheet template button.
Element Options
Stylesheet template button
In the stylesheet template add the stylesheet token and then the styles that you want to add to the artboard view.
Style for an element with an ID of "MyRectangle"
A style rule or style declaration is a way to select define a style or behavior for an element or a set of elements. You select specify which elements using a selector. More information linked at the end of this page.
Method 2 - Defining a hover effect class using a code block
<style>
/* remove underline from hyperlinks */
a {
text-decoration: none;
}
/* remove underline from hyperlinks nested in a div */
a:hover div {
text-decoration: underline;
}
/* add underline to hyperlinks on hover */
a:hover {
text-decoration: underline;
}
/* add underline to hyperlinks nested in a div on hover */
a:hover div {
text-decoration: underline;
}
</style>