|
Posted by Tim Roberts on 11/06/05 02:42
Frédéric Vailleau <fvailleau@sqli.com> wrote:
>
>I'm looking for the function used on the yahoo webmail which rewrite stylesheet.
>I developped a webmail and had a problem with mails using style associates on global tag (ie body)
>In fact, when the body tag has a style, my whole page is using this style ...
>The yahoo webmail modify the mail code to put the mail in a div with an id (called "message").
>And all the styles are prefixed by the name of the div.
>So, this code :
><STYLE type=text/css>
>BODY {
> BACKGROUND-COLOR: #f3e2b7; TEXT-ALIGN: center
>}
>...
>
>Become that :
><STYLE type=text/css>
>#message BODY {
> BACKGROUND-COLOR: #f3e2b7; TEXT-ALIGN: center
>}
>...
>
>Do you know the function which allow that ??
>Thanks in advance
There is no single function to do this, and no regular expression will be
enough, either. You will have to write your own code to scan through the
HTML, looking for <style> tags, and parse them yourself.
<style> sheets are usually nicely formatted, so it should be easier than
general-case HTML parsing.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Navigation:
[Reply to this message]
|