web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add Hover css in HtmlT...
Power Apps
Answered

Add Hover css in HtmlText on PowerApps

(0) ShareShare
ReportReport
Posted on by 8

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

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    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:

    118.png

    Have you missed quotations marks in HTMLText Box?

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Verified answer
    timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard