cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
felipito1
Helper II
Helper II

Use a background image on a HTML text

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

9 REPLIES 9
mdevaney
Super User
Super User

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

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)

 

 

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

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!

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

Well... thank you!

 

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 

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

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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,245)