Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Inlining linked CSS files

$
0
0
Re: Inlining linked CSS files
HTML, CSS, JavaScript, Flash
Re: Inlining linked CSS files
03/21/2012
06:28:20 AM
3GL0DVHUZ Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None

Hi,

Just to give an update on this. We came to the conclusion that is was indeed the advanced stuff that was not getting rendered properly. Pity.

In the end, we generated PDFs from the HTML. We use PDFFactory here which, sadly, is not one of the PDF classes shipped with wconnect. If anyone else uses PDFFactory and needs a wrapper to automate pdf generation... just get in touch. I'd be happy to share the code.

Anyway, it is working a treat now.

Laters

Mace



Are the styles in the actual files? Check and make sure. Remember the pathing is applied when the template is created.

Further, if there are background images and other related resources in the CSS those are not going to work because they likely point to relatively pathed resources (and if they aren't Outlook won't display them anyway). Additionally outlook doesn't render most advanced CSS stuff. Not sure about Word either...

+++ Rick ---



To answer my own question... it works in a browser. However, it is still not styling correctly in word or in the email client. I can't understand why not.

We've been told it would also be OK to send the html as a PDF. Do you have any utilities to generate a PDF from HTML?

Mace


Coolio,

This is exactly the issue we have. Emails to people that don't have access to the intranet can't access the style sheets. So I was thinking to embed them on emails.

Just wondering what would happen though if we have two style sheets. Do you think this would also work. Would the first definition be used?

<style> <%= FileToStr( Process.ResolvePath("~/css/mycss.css)) + FileToStr( Process.ResolvePath("~/css/westwind.css))%> </style>

Regards

Mace



Hi Macer,

Sure just use:

<style> <%= FileToStr( Process.ResolvePath("~/css/westwind.css)) %> </style>

Actually that just gave me a great idea myself :-) I have the same issue here on hte message board when sending emails. Since emails don't allow linked external stylesheets but do tend to allow embedded styles the same above might work, but using:

<%= loHttp.HttpGet("http://west-wind.com/wconnect/westwind.css") %>

+++ Rick ---

Hi,

Is there an easy way to inline styles that have linked in external css files.

We have a scenario that requires the styles that are defined in an linked css file to be imbedded into the html. It would be nice to optionally output html with the styles embedded for this. Any easy way?

Regards

Mace








Viewing all articles
Browse latest Browse all 10393

Trending Articles