Announcements
How can I add Hover css in HtmlText like
.myDIV:hover { display: block; color: red;}to
Set(CssHover,{ myDIV: "display: block; color: red;"}
}
)
then i call this variable by <div style='"& CssHover.myDIV &"' ></div>
I can pass css to PowerApps variable by Set() but I can not pass ':hover' to it.
@Solved: Re: It is possible to declare css in powerapps? - Power Platform Community (microsoft.com)
Best Regards
Hi @LazyLazy ,
Could you please share more details about what was the situation of "can not pass ':hover' to it"?
I made a test with your css code on my end, which which worked fine:
Have you missed quotations marks in HTMLText Box?
Hope this helps.
Best regards,
Community Support Team _ Jeffer NiIf this post helps, then please consider Accept it as the solution to help the other members find it.
Hi @LazyLazy
Unfortunately, it is not possible to apply a hover style to a div in a HTMLText control.
:hover is a pseudo-selector. It only has meaning with a style sheet, and there isn't an inline-style equivalent.
Power Apps does not support external style sheets and for this reason, it isn't possible to apply a hover style.
This Stack Overflow post provides some more discussion on pseudo selectors.
https://stackoverflow.com/questions/14141374/using-css-before-and-after-pseudo-elements-with-inline-css
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 530
WarrenBelz 459 Most Valuable Professional
Haque 314