Cristian Boariu
Cristian Boariu

Reputation: 9621

rss: cannot put style attribute into an img tag

I am building an rss feed and i have this for description:

string sDescription = "<a href=\"" + sLink+"\"><img style=\"padding:10px\" align=\"left\" style=\"padding:10px\" width=\""+CImageDimensions.getProductImageDetailedWidth(CCategorii.CARTI_ID,
        book.Carti_id) + "\" src=\"" + PathsUtil.getBaseUrl() + control.ResolveUrl(ImageUtils.getThumbnailUrl(book.Poza_1)) + "\"/></a><div style=\"padding: 10px\"><p>" + book.Descriere_mica + "</p></div>";

You see that i put a little bit of padding to the img attribute:

style=\"padding:10px\"

I do not understand why this is not loaded...I mean, in FF i see:

<img width="130" align="left" src="http://localhost:2440/gramma_prod/Images/Carti/Opere_complete_si_scoliile_Sfintului_Maxim_Marturisitorul1.Dionisie Aeropagitul_thumb.jpg"/>

All others attributes of img tag are taken correctly but style is missing...

Do you have any ideea why?

Upvotes: 1

Views: 222

Answers (2)

Softy
Softy

Reputation: 542

It's possible that not all the CSS features are supported in displaying RSS. In fact, RSS should only send information, not information about how to render the information within. Try this attributes: hspace and vspace. An example here: http://www.w3schools.com/TAGS/att_img_hspace.asp

Hope you the best luck!

Upvotes: 1

Dustin Laine
Dustin Laine

Reputation: 38503

You will need to HTML encode the output. http://msdn.microsoft.com/en-us/library/w3te6wfz.aspx

Upvotes: 0

Related Questions