cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LazyLazy
Frequent Visitor

Add Hover css in HtmlText on PowerApps

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

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

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-...

 

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

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.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

timl
Super User
Super User

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-...

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,746)