PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Sep 19, 2019 2:22 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Dec 29, 2010 4:22 pm 
Offline
Forum Newbie

Joined: Wed Dec 29, 2010 4:19 pm
Posts: 1
Hello everyone.

I was trying to make the embedded image as background of one of my divs >
Syntax: [ Download ] [ Hide ]
$message->setBody(
'<html>' .
' <head></head>' .
' <body>' .
'  <div style="background-image:url(\'' . $cid . '\');background-repeat:no-repeat;width:200px;height:150px;border:1px solid black;">test?</div>' .
'  <img src="' . $cid . '" alt="Image" />' .
' </body>' .
'</html>',
  'text/html' //Mark the content-type as HTML
);


The <img> is working but the div has no background img.
any idea how to make the img as background?

thanks


Top
 Profile  
 
PostPosted: Tue Jan 18, 2011 7:50 am 
Offline
Forum Commoner

Joined: Fri Oct 19, 2007 2:02 am
Posts: 55
Location: Vancouver, WA, USA
Note that you do not have the same HTML/CSS power in emails that you have on a Web page. For example, Outlook a few years ago became somewhat primitive when Microsoft chose to use the Word engine to display HTML. So, you cannot rely upon background images in your email. I believe you can use them in table cells, but not DIVs. You can do some testing to confirm this.

Also, note that you cannot use the HEAD and BODY tags in an email. Those are generally stripped away.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group