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

Community site session details

Session Id : Xxiov+97TPaIPlXFhHEHFt
Power Apps - Building Power Apps
Answered

Use a background image on a HTML text

Like (0) ShareShare
ReportReport
Posted on 2 Jun 2020 20:04:37 by 97

Hi People:


Good day, that is my question, is any way to use a image as background in a HTML Text?

 

Appreciate your help!

 

Thanks

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,987 Moderator on 02 Jun 2020 at 20:11:18
    Re: Use a background image on a HTML text

    @felipito1 

    There's no need to place a background image inside the HTML text.

     

    Simply place an Image control behind the HTML text control and make it have the same property for: X, Y, Height, Width.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • felipito1 Profile Picture
    97 on 02 Jun 2020 at 20:28:25
    Re: Use a background image on a HTML text

    Sorry,

     

    I belive I did not explain very well, my bad.

     

    I need this image inside this HTML text control as in the end of the process I need to email this HTML control as a body (it is a report)

     

     

  • mdevaney Profile Picture
    29,987 Moderator on 02 Jun 2020 at 20:30:15
    Re: Use a background image on a HTML text

    @felipito1 
    You can't place and image inside an HTML text control.  That is not it's purpose.  You will need to find another way.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • felipito1 Profile Picture
    97 on 02 Jun 2020 at 20:40:19
    Re: Use a background image on a HTML text

    sorry but it is possible, have a look on this post where I learnt:

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Picture-in-HTML-Text/td-p/153297

    What I need is use an image from a url as background image on this HTML text control.

     

    Apreciatte your help comunity!

  • mdevaney Profile Picture
    29,987 Moderator on 02 Jun 2020 at 21:06:55
    Re: Use a background image on a HTML text

    @felipito1 
    I retract my previous statement.  What I meant to say is images are not meant to be displaying using an HTML text control.  But that's beside the point.

     

    For what you are wanting to do it would require some HTML/CSS code. I've looked around and can't seem to find the answer either, sorry...

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • felipito1 Profile Picture
    97 on 02 Jun 2020 at 21:15:44
    Re: Use a background image on a HTML text

    Well... thank you!

     

  • timl Profile Picture
    35,805 Super User 2025 Season 2 on 02 Jun 2020 at 21:52:59
    Re: Use a background image on a HTML text

    Hi @felipito1 

    Unfortunately, the available options are limited.

    A possible workaround is to apply @mdevaney's workaround on your screen by placing an image control behind the HTML text control and setting the same property for: X, Y, Height, Width.

    Because the image will not appear when you use the HTML content in an email, you could wrap the HTML content in an outer DIV when you send the email. You would apply the CSS background-image property to this parent DIV to apply your background image.

    https://developer.mozilla.org/en-US/docs/Web/CSS/background-image 

  • Verified answer
    v-bofeng-msft Profile Picture
    on 03 Jun 2020 at 02:39:41
    Re: Use a background image on a HTML text

    Hi @felipito1 :

    Thanks to @timl  and @timl for their answers.

    I did some tests and the htmltext control does not display the background image.

    Because there are almost no other options, I suggest you use @timl 's solution.

    I've made a test for your reference:

    1\Add a html text control(HtmlText1):

    Text:

     

    "<html>
    <body background="&First(MyPhoto).PIC&"> /*First(MyPhoto).PIC is my picture*/
    <p>TestTest</p>
    <p>TestTest</p>
    </body>
    </html>
    "

     

    Although this code is correct, the background image does not appear

    1.JPG

    2\Add a image control:

    Image:

     

    First(MyPhoto).PIC

     

    Width:

     

    HtmlText1.Width

     

    Height:

     

    HtmlText1.Height

     

    X:

     

    HtmlText1.X

     

    Y:

     

    HtmlText1.Y

     

    3\Add a flow(sendemail)

    1.JPG

    4\Add a button:

    OnSelect:

     

    sendemail.Run(HtmlText1.HtmlText)

     

     

     2.JPG3.JPG4.JPG

    In addition,If you want the htmltext control to support the background image function, you can submit your ideas to this forum:

    https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

    Best Regards,

    Bof

  • albertvangink Profile Picture
    11 on 01 Sep 2021 at 12:22:03
    Re: Use a background image on a HTML text

    How do you come to "&First(MyPhoto).PIC&"?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete